I tried this in a Vaadin 18 app, and it doesn’t work for me outside of the DemoView. The DemoView adds things to the layout in a specical way - using a WhenDefinedManager, which is used within the vaadin DemoView.addCard(…) method. I’m not sure why it uses that, but the tooltip doesnt work for me without it.
e.g. You have to do something like this to get it to work.
card.getElement().getNode().runWhenAttached(ui -> {
WhenDefinedManager.get(ui).whenDefined(new Component[] {button,tooltip}, () -> {
card.add(button,tooltip);
});
});
Even within the demo app, if I take the DemoView and convert it to a Vertical Layout, the tool tips no longer work.
Is there a sample somewhere of it being used outside of a DemoView that I can compare to?
Edit: I noticed a few days ago that it started working. I’m not sure exactly why. I had tried clearing the browser cache as other users suggested, but pheraps I failed. So it does seem to work eventually but I believe there may still be some issues with it running on the first attempt.