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 input width in MultiSelect UI components #2701

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

mikiher
Copy link
Contributor

@mikiher mikiher commented Mar 3, 2024

Fixes #2700 (see details in the bug).

Note that setInputWidth was removed, and with it the call to this.RecalcMenuPos().
I'm not sure why this call is required. If it is, let me know and I'll try to re-incorporate it where it makes sense.

@mikiher mikiher marked this pull request as ready for review March 3, 2024 21:48
@advplyr
Copy link
Owner

advplyr commented Mar 5, 2024

I'm not sure why I put the recalc there but I wrote that a long time ago so it may have gone through a few refactors. This is working great in my testing, thanks!

@advplyr advplyr merged commit 6e8c6aa into advplyr:master Mar 5, 2024
1 check passed
@mikiher
Copy link
Contributor Author

mikiher commented Mar 5, 2024

Actually, I played with it a bit more today, and I'm not happy with my fix.

  1. I examined in more detail what is the actual width after each letter is entered. It turns out that setting "width: fit-content" just sets a larger initial value for the width (163px, not sure how it's calculated), and it doesn't change at all when the input changes. It just seems like it works because of the larger initial width, but after you type enough, you only see the end of what you typed and the beginning is cut-off.
  2. I think I now understand why recalcMenuPos is required - assuming width modification really works as expected, you could potentially have the inputWrapper div span more than one line, and the menu position needs to change when this happens.

I think I found another solution that requires less changes and really modifies the width.
Can you please revert the merge?

@mikiher
Copy link
Contributor Author

mikiher commented Mar 6, 2024

OK, don't bother to revert, I'll just send a new PR

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.

[Bug]: Author text input gets clipped when editing book details
2 participants