phax / ph-oton

The complete ph websuite
Apache License 2.0
3 stars 5 forks source link

BootstrapFormHelper:connectFormControlWithLabel improvement #18

Closed NikovacsDev closed 4 months ago

NikovacsDev commented 4 months ago

The current method uses setAriaLabeledBy:

public static void connectFormControlWithLabel (@Nullable final IHCElement <?> aCtrl, @Nullable final HCFormLabel aLabel) {
    if (aCtrl != null && aLabel != null)
    {

      // Set "for" in label
      aLabel.setFor (aCtrl);

      // Set "aria-labelledby"
      aCtrl.customAttrs ().setAriaLabeledBy (aLabel);
    } } 

Wouldn't it be better if instead it uses the method addAriaLabeledBy? The difference would be that you could add ids before the connectFormControlWithLabel is called, at the moment that is not possible because the set overwrites the previously added ids.

phax commented 4 months ago

Thanks. Fixed. Will be part of the netx 9.2.5 release