RadioButtonGroup ItemEnableProvider doesn't work when disabled RadioButtonGroup is enabled
jool77 opened this issue · 0 comments
jool77 commented
Environment
Vaadin 14.4.7
Description
When disabled RadioButtonGroup (with ItemEnableProvider defined) is enabled, also items that should be disabled are actually in enabled state. User can even click and select the disabled item. After click the item changes to disabled.
Expected result
When RadioButtonGroup is enabled, all items for which ItemEnableProvider return false should be disabled.
Actual result
Also disabled RadioButton items are enabled and user can select them.
Example code
@Route
public class TestView extends Div {
public TestView() {
RadioButtonGroup<String> rb = new RadioButtonGroup<>();
rb.setItems("First", "Second");
rb.setItemEnabledProvider(item -> "First".equals(item));
rb.setEnabled(false);
Button b = new Button("Enable");
b.addClickListener(event -> rb.setEnabled(true));
add(b, rb);
}
}
Steps to reproduce
- Run provided example code
- Click displayed button to enable RadioButtonGroup
- Click item "Second" which should be disabled