-
Notifications
You must be signed in to change notification settings - Fork 83
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
Conversation
@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. |
@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 Tested and the search input position issue is fixed now 👍 Regarding the other one, is it planned to be handled in a separate PR?
|
@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. |
🎉 This PR is included in version 3.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
After
Test instructions
Check before Pull Request is ready:
Closes #4017