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

XWIKI-21729: Bad interaction between quick search and the drawer #2835

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Feb 1, 2024

Jira URL

https://jira.xwiki.org/browse/XWIKI-21729

Changes

Description

  • 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)

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

  • Prefers squash: Yes
  • Backport on branches:
    • 15.10.X to match with XWIKI-16140 and XWIKI-20733. IMO this is quite a low risk backport.

@Sereza7 Sereza7 added the backport stable-15.10.x Used for automatic backport to 15.10.x branch. label Feb 1, 2024
@@ -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 */
Copy link
Member

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.

Copy link
Contributor Author

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 👍

@Sereza7 Sereza7 marked this pull request as draft August 26, 2024 16:20
* 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
@Sereza7 Sereza7 marked this pull request as ready for review October 10, 2024 09:58
@surli surli removed the backport stable-15.10.x Used for automatic backport to 15.10.x branch. label Oct 31, 2024
@surli surli merged commit 9f4ace5 into xwiki:master Oct 31, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants