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
Unified Tooltip handling needed in component Java API's #4169
Comments
The element I don't see any other concept that would provide of framework level tooltips for everything. I think that it should be made as a web component that can maybe then be applied to any element. We could then have an integration for that in Flow, but I don't see us implementing (ever) a Flow specific tooltip feature that could be applied to all components out of the box. This type of feature does however provide value for lots of apps, so it should be something that we provide regardless of using Flow or just the web components (I think). @jouni what are your thoughts on this ? I don't think all of our web components even have a tooltip as component feature. |
None of our web components have a tooltip feature. I suppose what Flow users want are a convenience/helper APIs that work on the component API level. On a low level, a web component is indeed the technical solution. There’s already |
Thanks for you help Tatu, I'm sold on using an existing webcomponent as a tooltip, maybe point the user to the webcomponent section and provide and example on using in a button or grid. Here under the heading "Tooltips are component specific" https://vaadin.com/docs/v10/flow/migration/5-components.html I'm not sure textfield would require it as there is already the title and placeholder to describe its entry. If the app required a more complex user input a text or paragraph would be more suitable to display information about the intended input. You don't want to have to keep hovering over the textfield while working out what it is you need to enter. Just brainstorming, using a tooltip in grid would be needed where a button or specific item was needed, which again is easy enough to do using the webcomponent as you've given us the ability to use a renderer. But a popout help tab could also do the trick, explaining the columns in more detail. Loving V10. |
As a short term solution, I copied this code from HtmlComponent into my Button extension class:
|
Just to give my 5c to this discussion, I would be happy with just a convenient API for setting the Its implementation could later be changed to a more accessibility-friendly solution. |
If we won't provide an API, users will create their own, e.g. #5903 |
For better AT (e.g. screen reader) support, a |
Tooltip is really needed to be there for all vaadin component in such an easy way as |
As an update to this, we are planning on providing a tooltip feature for components, but I can't yet say when nor what kind of feature that will be (i.e. whether plaintext, rich text, using the native title attribute or a separate component, with or without touch support, etc), but it is planned to be added. In the meantime, for most cases the workaround is as simple as Some disabled components won't show a tooltip set that way, as they have the
(I'm not saying this is a complete solution to all your tooltip needs, but it should cover the majority of common use cases.) |
Linking this here for ideas: https://inclusive-components.design/tooltips-toggletips/ |
Internally collecting use cases for tooltips here: https://docs.google.com/spreadsheets/d/1cIlcSKcNs_slk1nRl7yMdKJYi147RKyf8njcHbly3LA/edit?usp=sharing (others can add their use cases, if not already mentioned here, as issue comments) |
How about the most simple getElement().setAttribute("title", "Tooltip"); like here: Okay, I understand ...but it is what some people would like to use, due to its ease of use and simplicity. |
Not entirely sure what you mean there @enver-haase. Setting the This issue is about providing a nicer API for doing that, that also works well in terms of accessibility, ideally also for touch devices, and maybe with rich content support (i.e. formatting). |
Fight for Simplicity --- in this case, I believe we should just add it, and if we need four years to discuss an ARIA-friendly version, comment the non-conformity in the new Component.setTitle(String) and then add some ARIA compatible version years later when it is properly designed, on top or as a compatible replacement. |
See my revised PR above. Can we agree on that? |
I would suggest to re-open this ticket. Yes, the PR adds a small improvement but doesn't fix the original ticket about "real" tool-tip support. |
Agree, let's keep it opened for further improvements. |
I am closing this as the feature was implemented in Vaadin 23.3.0. |
At the moment tooltips are implemented as per component.
In Vaadin 8 the tooltip API was coherent in whole framework. It would be desirable to have the same in Vaadin 10 as well.
Have setTooltip(..) (or something similar) API for each component
Have setTooltipGenerator(..) (or something similar) for components with item list like ComboBox, Grid, ...
The text was updated successfully, but these errors were encountered: