Vaadin 14 - Disable Hovering Response on Buttons

Viewed 225

Is it possible to disable the hovering functionality for Buttons? I haven't come across any methods that facilitate this, so I'm guessing writing a custom function might be required here.

1 Answers

You can change the hover with CSS.

Add CSS file with this content. opacity: 0 will disable the change on hover.

:host(:hover)::before {
    opacity: 0;
}

Then you have to import it for the vaadin-button like this:

@CssImport(value = "./themes/vaadindemo/components/button.css", themeFor = "vaadin-button")

Please find a running example here:

https://github.com/simasch/vaadin-examples

Related