ui5-webcomponents
ui5-webcomponents copied to clipboard
ui5-button: ':focus' pseudo-class is not working
Describe the bug :focus psuedo-class when added to a ui5-button does not apply the corresponding styles to the button when it is focused.
To reproduce Steps to reproduce the behavior:
- Go to https://sap.github.io/ui5-webcomponents/playground/components/Button/
- Add ':focus' to any of the buttons and add the style 'background-color:green'
- Tab over to that button such that the focus is on the button
- Notice that the button does not have a green background.
Expected behavior Adding ':focus' pseudo-class to the button should add the corresponding styles to the button when focused on, i.e., the button should have a green background when it is focused on.
Hi @rama1990br
If you wish to style the focused button you can use the focused attribute which we are setting internally:
ui5-button[focused] {
background-color: green;
}
Best regards, Filip
Hi @fifoosid, The solution proposed by you works. Thanks for the quick response!
Thanks, Rama