-
-
Notifications
You must be signed in to change notification settings - Fork 550
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
XWIKI-21729: Bad interaction between quick search and the drawer #2835
Conversation
...rm-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/search/searchSuggest.js
Outdated
Show resolved
Hide resolved
@@ -118,7 +118,9 @@ var XWiki = (function (XWiki) { | |||
* Callback triggered when the suggest element is collapsed, because of a focusout event for example. | |||
*/ | |||
onSuggestCollapsed: function(event) { | |||
this.suggest.clearSuggestions(); | |||
/* We match the collapse of the input field timing to close the suggest panel. | |||
As of 16.2.0-RC1, this value is defined in action-menus.less -> #headerglobalsearchinput */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the doc improvment. Just to be sure: there's no way to actually extract the data from the CSS rule with some javascript? e.g. in xwiki.org I'm able to get it using jQuery('#headerglobalsearchinput').css('transition-duration')
(not sure it works with all browsers tbh).
My point here is I'm afraid we forget to update this value if we ever change the less file and it can also be modified for having a custom skin, which would make that code not efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment! I didn't know JQuery offered this feature. It seems to work well on recent FF and Chromium.
I updated it in 0531d28
I never even looked for such a feature because it looked to me like a violation of the MVC principle. Having the object behave in a different way only based on its style didn't sound right to me. In this use case it's convenient and somewhat appropriate 👍
* Fired an event that was overwise unused * Fixed its listener * Added an optional argument for the suggest resetTimeout function (to allow a more precise control of the suggest panel)
* Added a comment to explain the origin of a hard coded timer.
* Improved the JS to retrieve the timing value from the CSS
Jira URL
https://jira.xwiki.org/browse/XWIKI-21729
Changes
Description
Screenshots & Video
Video demo: https://youtu.be/_XcDOmUG870
Executed Tests
None, because 'cause changes' in XWIKI-16140 and/or XWIKI-20733 did not impact any tests (except webstandards, for reasons unrelated to the changes in this PR).
Expected merging strategy