vaadin / flow-components

Java counterpart of Vaadin Web Components
99 stars 65 forks source link

Radio Button Reset option #1647

Open Meghna2528 opened 4 years ago

Meghna2528 commented 4 years ago

radioButton.clear(); radioButton.setSelectedItem(null);

Nothing works when trying to reset radio buttons. (Or double clicking a radio button should deselect it).

anezthes commented 4 years ago

radioButton.clear(); radioButton.setSelectedItem(null);

This need has come up a lot. +1.

(Or double clicking a radio button should deselect it).

Never seen this before, not sure we wanna do that.

web-padawan commented 4 years ago

This might be not needed if we fix vaadin/vaadin-radio-button-flow#67 and make sure that setValue(null) actually works.

leluna commented 1 month ago

We have the problem now, that setValue(null) clears the values. We want to display null as an explicit option when using radio buttons. However, clicking on the null value clears the selection, which is missleading, as the null value is indeed selected.