How to programmatically force blur on a button ?

Hello,

I created CSS styles for a vaadin button (default and :hover) and it works fine.
When I click on the button, the :focus CSS is set and then, the :hover does not work anymore (normal behavior).

What I would like to do is to loose the focus as soon as the button gets it, so the style gets back to the one I created (and :hover works again).

I tried to add a FocusListener and a BlurListener, and in the focus listener, I call the blur() method of the BlurListener but it does not work. I mean, that the blur() method is really called but it does not change the CSS style.

Here is the code:

		Button button = new Button("button");
		button.addStyleName("mybutton");
		BlurListener blurListener = new BlurListener() {
			@Override
			public void blur(BlurEvent event) {
				button.markAsDirty();
			}
		};
		button.addBlurListener(blurListener);
		button.addFocusListener(e -> blurListener.blur(new BlurEvent(button)));

How can I programmatically force the button to loose the focus ?
Thank you !

Note: If I create a second button and call “secondButton.focus()” in the BlurListener then it works (button looses its focus) but I don’t want to do that.