You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Select and DataSelect form controls do not re-enable properly when you call SetDisabled(false). This assumes that the SetDisabled(true) was called at some point in the past. This is because WidgetDropDown sets the pseudo-class "disabled" to true (in OnLayout method), but never undoes that change for child elements - even if the disabled flag was set to false.
I fixed the issue by changing the following if statement in void WidgetDropDown::OnLayout() method:
Before: if(parent_element->IsDisabled()) { // Propagate disabled state to selectvalue and select arrow value_element->SetPseudoClass("disabled", true); button_element->SetPseudoClass("disabled", true); }
After (added the 'else' statement): if(parent_element->IsDisabled()) { // Propagate disabled state to selectvalue and selectarrow value_element->SetPseudoClass("disabled", true); button_element->SetPseudoClass("disabled", true); } else { // Undo the disabled state change to selectvalue and selectarrow value_element->SetPseudoClass("disabled", false); button_element->SetPseudoClass("disabled", false); }
This fixes the issue, and the child elements update themselves and no longer misbehave when disabling/enabling the select/dataselect controls.
Sorry if this is not the best way to submit solutions to bugs - I have no idea how to do this in github.
The text was updated successfully, but these errors were encountered:
Thanks, I'll take a look at it. My only concern out of the box is that this re-enables children without taking into account that those children may have been disabled separately. It just needs to be consistent with the behavior elsewhere in the library so I'll take a look.
The child elements in this case are only selectvalue, and selectarrow, but I will not say 'no' to testing. Thanks for the attention and document link, much appreciated!
The Select and DataSelect form controls do not re-enable properly when you call SetDisabled(false). This assumes that the SetDisabled(true) was called at some point in the past. This is because WidgetDropDown sets the pseudo-class "disabled" to true (in OnLayout method), but never undoes that change for child elements - even if the disabled flag was set to false.
I fixed the issue by changing the following if statement in void WidgetDropDown::OnLayout() method:
Before:
if(parent_element->IsDisabled())
{
// Propagate disabled state to selectvalue and select arrow
value_element->SetPseudoClass("disabled", true);
button_element->SetPseudoClass("disabled", true);
}
After (added the 'else' statement):
if(parent_element->IsDisabled())
{
// Propagate disabled state to selectvalue and selectarrow
value_element->SetPseudoClass("disabled", true);
button_element->SetPseudoClass("disabled", true);
}
else
{
// Undo the disabled state change to selectvalue and selectarrow
value_element->SetPseudoClass("disabled", false);
button_element->SetPseudoClass("disabled", false);
}
This fixes the issue, and the child elements update themselves and no longer misbehave when disabling/enabling the select/dataselect controls.
Sorry if this is not the best way to submit solutions to bugs - I have no idea how to do this in github.
The text was updated successfully, but these errors were encountered: