Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior when selecting pull-down items #23

Open
D-fujinami opened this issue Sep 11, 2023 · 5 comments
Open

Behavior when selecting pull-down items #23

D-fujinami opened this issue Sep 11, 2023 · 5 comments
Assignees

Comments

@D-fujinami
Copy link

When I create a new ticket in redmine, when I click on a pull-down item
the screen scrolls to the bottom and I have to go back to the pull-down.
Is there any way to fix this?

A similar event seems to be occurring with select2 4.0.12, which is used inside Redmine.
It seems like it could be handled by updating the version of select2 used in the plugin, though,
Does redmine_searchable_selectbox support select2 4.0.13?
select2/select2#5734

Environment:
  Redmine version                5.0.2.stable
  Ruby version                   3.0.4-p208 (2022-04-12) [x86_64-linux]
  Rails version                  6.1.6
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Farend_bleuclair (includes JavaScript)
SCM:
  Subversion                     1.14.2
  Git                            2.36.1
  Filesystem                     
Redmine plugins:
  additional_tags                1.0.7
  additionals                    3.0.8
  ankoalm_ganttchart             3.2.19
  openalm_common                 1.7.7
  redmine_searchable_selectbox   0.1.10
  redmine_slack                  0.2

*This post uses Google Translate.

@ishikawa999
Copy link
Collaborator

@D-fujinami

Thank you for the feedback.
I couldn't reproduce the issue in my environment, but I've updated select2 to version 4.0.13 as a precaution.
Could you please check if the issue is resolved?

https://github.com/farend/redmine_searchable_selectbox/releases/tag/v0.1.11

@nightmeteora
Copy link

@D-fujinami

Thank you for the feedback. I couldn't reproduce the issue in my environment, but I've updated select2 to version 4.0.13 as a precaution. Could you please check if the issue is resolved?

https://github.com/farend/redmine_searchable_selectbox/releases/tag/v0.1.11

It does not work even I updated select2 to 4.1.0_rc. Finally I happened to find the root cause of a repro via chrome dev tools.

when additional_tags plugin was installed at same time, its loads select2 and transforms textarea with class .select2-search__field, which is target element to focus on by seachable_selectbox

// Fix a problem with focus not working in Redmine 5.0 or later.
// issue: https://github.com/select2/select2/issues/5993
$(document).on('select2:open', function() {
  document.querySelector('.select2-search__field').focus();
});

the additional_tags textarea locates at the almost bottom of the new issue page, the focus() triggers the scrolling-down.

I did a quick fix and it works well for me. I am not familiar with JS, please correct me if it has potential issue.

//workaround
- document.querySelector('.select2-search__field').focus();
+ document.querySelector('input.select2-search__field:not([placeholder="Add tags"])').focus();

@ishikawa999
Copy link
Collaborator

ishikawa999 commented Dec 8, 2023

@nightmeteora
Ah, I see, it was influenced by other plugins. If the code you suggested resolves the issue, it seems like a good solution as it would not harm users who are not using the plugins. Please give me some time to gather the plugins and verify this when I have a moment.
thank you for your feedback.

@ishikawa999 ishikawa999 self-assigned this Dec 8, 2023
@hxqqqqqq
Copy link

I found that using the default theme does not have this issue, but using "Purplemine2-2.16.2" only has this problem. So what is the specific reason for this, huh? Do any experts have a solution?

@ashrafalzyoud
Copy link

@hxqqqqqq
@ishikawa999
@nightmeteora
@D-fujinami
@vividtone

in redmine 5.1.3
the problem conflict with redmine_search selct boc with all redmineup contacts
the page up and down
and when click for field type(contact) multi search open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants