Aria-Complementary-Label-Visible Form - Final #1066
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new form for dealing with the issue ruleset: aria_complementary_label_visible which requires clickable elements. This allows for the preview on the right of the form to be now interactable.
Key Changes
A new state variable
previewInfois being passed by the parent componentFixIssuesPage.jstoFixIssuesContentPreview.jsandUfixitWidget.jswhich allows it to be used by the preview element + the form. This is the main input for this form and form is checked for errors and saved using this variableA new state variable
copiedContentItemis being passed down from the parent componentFixIssuesPage.jstoFixIssuesContentPreview.jswhere it is being used to keep track of newly added IDs to elements that are NOT theactiveIssueelement. ThehandleIssueSave()function now checks this variable and priortizes the html stored in it before saving.Also check the following functions in
FixIssuesContentPreview.jsfor in-depth understanding of how the functionalities work:addIdToElementInHtml(htmlString, xpath, generatedId)removeIdToElementInHtml(htmlString, xpath, id)handlePreviewValues = (newId, selectedFlag = false)handleClickablePreview = (e)Functionalities
When this form is now active we can click on any elements on the right EXCEPT the element pointed to by the
activeIssue.The following behaviour is expected:
When clicking on an element with an already EXISTING ID, it is highlighted and the ID is saved in
previewInfofor later savingWhen clicking on an element with a NON-EXISTING ID, it:
copiedContentItemfor later savingWhen clicking on an already selected element, it is deselected with all IDs reset to correct values
When clicking on an already selected element with a custom generated ID, the ID is removed and then deselected
Clicking anywhere else on the preview container deselects everything and resets everything
Testing
To test this form:
asideelement with an aria-label attribute.