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

Fix wrong position of search input on minimal when it does not fit in the space. #4165

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Dec 4, 2023

Summary

By default, the search input is positioned on the left or the right of the search icon, depending on the position. The input popup might be partially offscreen if the search icon is in the middle of a position not too close to the edge.

To solve this, I added an extra step that rechecks if the search input fits. If not, I add an extra offset on the X-axis, which solves the offscreen bug. ℹ️ This is the solution with the least amount of code, which helps us to stay below the limit.

Tip

Create an alias for document.window to save space. The build does not do an aggressive optimization to do this step automatically.

Will affect visual aspect of the product

YES

Screenshots

Before

Screenshot 2023-12-04 at 11 37 54

After

Screenshot 2023-12-04 at 11 36 47

Test instructions

  • Like in the issue, position the icon search near the middle and check in a small window.

Check before Pull Request is ready:

Closes #4017

@Soare-Robert-Daniel
Copy link
Contributor Author

@preda-bogdan @GrigoreMihai Since my solution adds new code, I am over the limit size. Do you see how I can make it fit the size limit (refactor some code, a smaller solution, trim some fat code elsewhere)?

I am still trying to figure out what else I can do.

@preda-bogdan
Copy link
Contributor

@Soare-Robert-Daniel we can see if we have any refactor opportunities to reduce the size, also you can just emit an event and have an inline script added when the search input is being used that will recalculate that instead of being part of the dropdown script, just an ideea.

@Soare-Robert-Daniel Soare-Robert-Daniel linked an issue Dec 5, 2023 that may be closed by this pull request
@Soare-Robert-Daniel Soare-Robert-Daniel added the pr-checklist-skip Allow this Pull Request to skip checklist. label Dec 5, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Dec 5, 2023
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review December 5, 2023 08:16
@pirate-bot
Copy link
Collaborator

Plugin build for c220012 is ready 🛎️!

@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Dec 5, 2023
@irinelenache
Copy link
Contributor

@Soare-Robert-Daniel Tested and the search input position issue is fixed now 👍

Regarding the other one, is it planned to be handled in a separate PR?

The search icon doesn't work when it's added in the mobile sidebar, no matter what open behaviour i'm using (minimal, canvas, float above header) https://vertis.d.pr/v/FS6RPv

@Soare-Robert-Daniel
Copy link
Contributor Author

@irinelenache, I will handle the other part in a separate PR. It seams that the detection is broken and I believe it will require a refactor.

@preda-bogdan preda-bogdan merged commit 4f3c529 into development Jan 26, 2024
40 checks passed
@preda-bogdan preda-bogdan deleted the fix/search-icon branch January 26, 2024 12:52
@pirate-bot
Copy link
Collaborator

🎉 This PR is included in version 3.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search icon issues on mobile
4 participants