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-22148: The search results are not hidden when the focus moves out of the quick search field #3103

Merged
merged 2 commits into from
May 15, 2024

Conversation

manuelleduc
Copy link
Contributor

Jira URL

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

Changes

Description

  • Define a css selector for the search results when the focus is out of the search field
  • Define a transition when the search results get hidden (I'm not really satisfied of the result for now, if somebody has a suggestion for improvement, @tkrieck maybe?)

Screenshots & Video

Screencast.from.06-05-2024.15.44.39.webm

Executed Tests

Manual tests.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • stable-16.3.x
    • stable-15.10.x

@manuelleduc manuelleduc added backport stable-15.10.x Used for automatic backport to 15.10.x branch. backport stable-16.3.x labels May 6, 2024
@tkrieck
Copy link
Contributor

tkrieck commented May 6, 2024

The animation is a bit awkward because the results are being positioned relative to the left of the bounding box (with a negative value). So when the input is shrunk to 0 the result box follow this change in size from the left margin. The animation will be nicer if you could change it to the right and with a positive number (this will be the size of the search icon bounding box).

I don't know the complexity of this because I did it only in web tools.

Before:
Screenshot 2024-05-06 at 13 08 17

After:
Screenshot 2024-05-06 at 13 12 57

Animation with the change:

Screen.Recording.2024-05-06.at.13.19.05.mp4

@manuelleduc
Copy link
Contributor Author

I don't know the complexity of this because I did it only in web tools.

Seems a bit complicated, changing the positioning the way you suggest implies changing the positioning logic of XWiki.widgets.Suggest (see

if (this.options.align == 'left' || (this.options.align == 'auto' && inputPositionLeft + this.options.width < browserWidth)) {
) which feels a bit risky for a bugfix.

Another option is to simply not have any animation, I feel like it's nicer to just see the results disappear instantaneously than to have an inconsistent animation.
WDYT?

@tkrieck
Copy link
Contributor

tkrieck commented May 15, 2024

I don't know the complexity of this because I did it only in web tools.

Seems a bit complicated, changing the positioning the way you suggest implies changing the positioning logic of XWiki.widgets.Suggest (see

if (this.options.align == 'left' || (this.options.align == 'auto' && inputPositionLeft + this.options.width < browserWidth)) {

) which feels a bit risky for a bugfix.
Another option is to simply not have any animation, I feel like it's nicer to just see the results disappear instantaneously than to have an inconsistent animation. WDYT?

I was not aware of the logic behind it. In that case I agree that disabling the animation seems to be the best option.

@manuelleduc manuelleduc merged commit 296efb7 into xwiki:master May 15, 2024
1 check passed
github-actions bot pushed a commit that referenced this pull request May 15, 2024
…ut of the quick search field (#3103)

(cherry picked from commit 296efb7)
github-actions bot pushed a commit that referenced this pull request May 15, 2024
…ut of the quick search field (#3103)

(cherry picked from commit 296efb7)
manuelleduc added a commit that referenced this pull request May 15, 2024
…ut of the quick search field (#3103) (#3115)

(cherry picked from commit 296efb7)

Co-authored-by: Manuel Leduc <manuel.leduc@xwiki.com>
manuelleduc added a commit that referenced this pull request May 15, 2024
…ut of the quick search field (#3103) (#3116)

(cherry picked from commit 296efb7)

Co-authored-by: Manuel Leduc <manuel.leduc@xwiki.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable-15.10.x Used for automatic backport to 15.10.x branch. backport stable-16.3.x
Projects
None yet
2 participants