Open D-fujinami opened 1 year ago
@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
@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();
@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.
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?
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? https://github.com/select2/select2/pull/5734
*This post uses Google Translate.