Skip to content

Accessibility improvements: add missing labels for input fields#2970

Open
labkey-susanh wants to merge 7 commits intodevelopfrom
fb_inputLabels
Open

Accessibility improvements: add missing labels for input fields#2970
labkey-susanh wants to merge 7 commits intodevelopfrom
fb_inputLabels

Conversation

@labkey-susanh
Copy link
Copy Markdown
Contributor

@labkey-susanh labkey-susanh commented Apr 29, 2026

Rationale

For better accessibility of our input forms, we need to provided proper labels for each field and not label things that aren't input fields.

Related Pull Requests

Changes

  • Update locators to account for label changes
  • Add EntityBulkDialog component with specialized methods for the Amounts and Units row with two input fields.

return elementCache().formRowByControlLabel(fieldLabel);
}

public Pair<String, String> getAmountUnit()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe getAmountAndUnitsReadOnlyValues or something to distinguish it from getAmountUnitValue.
This could also return a record instead of a pair for better readability, but not necessary.

return new Pair<>(amountVal, unitVal);
}

public Pair<String, String> getAmountUnitValue()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getAmountAndUnitsValues? or getAmountAndUnitsEditableValues?

return new Pair<>(amountVal, unitVal);
}

public void enableAmountUnit()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public void enableAmountUnit()
public void enableAmountAndUnits()

}
}

public void disableAmountUnit()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public void disableAmountUnit()
public void disableAmountAndUnits()

if (toggle != null && !toggle.isOn())
{
toggle.set(true);
_changeCounter++;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is _changeCounter meant to increment by only one when potentially both fields are updated?

public void disableAmountUnit()
{
ToggleButton toggle = new ToggleButton.ToggleButtonFinder(getDriver()).findOrNull(getAmountUnitsRow());
if(toggle != null && toggle.isOn())
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(toggle != null && toggle.isOn())
if (toggle != null && toggle.isOn())

}

if (amount != null && unit != null)
_changeCounter++;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here about whether this is one change or two.

protected abstract class ElementCache extends ModalDialog.ElementCache
{
protected final Locator textInputLoc = Locator.tagWithAttribute("input", "type", "text");
protected final Locator checkBoxLoc = Locator.tagWithAttribute("input", "type", "checkbox");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
protected final Locator checkBoxLoc = Locator.tagWithAttribute("input", "type", "checkbox");
protected final Locator checkboxLoc = Locator.tagWithAttribute("input", "type", "checkbox");

return new FilteringReactSelect(formRow(fieldIdentifier), getDriver());
}

public Checkbox checkBox(CharSequence fieldIdentifier)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public Checkbox checkBox(CharSequence fieldIdentifier)
public Checkbox checkbox(CharSequence fieldIdentifier)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants