-
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
Text Area: clear / suffix / prefix buttons scroll out of view #7673
Comments
This issue has been added to the backlog priority queue for further investigation. |
@paodb We looked into possible solutions, but unfortunately fixing this will likely require a breaking change. So fixing this will take longer, at least until the next minor, or possibly the next major. There is a related issue for allowing users to resize the text area, which would also require a breaking change, so we might want to tackle those together at some point. As an alternative I can provide two simple workarounds using CSS: 1 - Make the internal textarea scrollable This changes the internal text area to be scrollable. Note that this moves the scroll bar to the left of the clear button or any suffix component. vaadin-text-area textarea {
max-height: 100%;
overflow: auto;
} 2 - Use position: sticky on prefix and suffix components This prevents prefix and suffix components scrolling out of the viewport. Note that this also moves the clear button to the top, otherwise the clear button would still scroll until it reaches the top and then stop scrolling there. vaadin-text-area [slot="prefix"],
vaadin-text-area [slot="suffix"],
vaadin-text-area::part(clear-button) {
align-self: flex-start;
position: sticky;
top: 0;
} |
Hmm, are there any other drawbacks to workaround #2 above than that the clear button is always rendered at the top instead of in the vertical center? Because if not, I'm starting to feel like that might be not only a very innocuous breaking change but possibly actually preferable, especially if prefix/suffix elements are also used. If that's the only drawback, I would be in favor of just shipping that change as-is in the next minor. |
Currently, you can change the alignment of prefix, suffix or clear button using Bildschirmaufnahme.2024-09-30.um.10.03.52.movIf we make this change, then you'd have to change alignment using vaadin-text-area [slot="prefix"],
vaadin-text-area [slot="suffix"],
vaadin-text-area::part(clear-button) {
top: 50%;
transform: translateY(-50%);
} Edit: That's only the case when the component is scrollable though, using |
Description
If the Text Area has a fixed height and contains a clear button or other suffix/prefix, these buttons can be scrolled out of view when entering a multiline content.
Expected outcome
Clear button or other suffix/prefix should stay visible.
Minimal reproducible example
Steps to reproduce
Environment
Vaadin version(s): 24.4.8
Browsers
No response
The text was updated successfully, but these errors were encountered: