Accessibility improvements: add missing labels for input fields#2970
Accessibility improvements: add missing labels for input fields#2970labkey-susanh wants to merge 7 commits intodevelopfrom
Conversation
…uts (e.g., StoredAmount and Units)
… setters to use helpers in abstract EntityBulkDialog
| return elementCache().formRowByControlLabel(fieldLabel); | ||
| } | ||
|
|
||
| public Pair<String, String> getAmountUnit() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
getAmountAndUnitsValues? or getAmountAndUnitsEditableValues?
| return new Pair<>(amountVal, unitVal); | ||
| } | ||
|
|
||
| public void enableAmountUnit() |
There was a problem hiding this comment.
| public void enableAmountUnit() | |
| public void enableAmountAndUnits() |
| } | ||
| } | ||
|
|
||
| public void disableAmountUnit() |
There was a problem hiding this comment.
| public void disableAmountUnit() | |
| public void disableAmountAndUnits() |
| if (toggle != null && !toggle.isOn()) | ||
| { | ||
| toggle.set(true); | ||
| _changeCounter++; |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
| if(toggle != null && toggle.isOn()) | |
| if (toggle != null && toggle.isOn()) |
| } | ||
|
|
||
| if (amount != null && unit != null) | ||
| _changeCounter++; |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
| public Checkbox checkBox(CharSequence fieldIdentifier) | |
| public Checkbox checkbox(CharSequence fieldIdentifier) |
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
EntityBulkDialogcomponent with specialized methods for the Amounts and Units row with two input fields.