Open phenderson00 opened 2 years ago
Research if repo outside of React to determine next steps.
Can repro outside of React with https://codepen.io/geospatialem/pen/ExeOZBO.
Workaround (non-framework example) adding the label
prop to the calcite-button
mentioned above: https://codepen.io/geospatialem/pen/gOdQMPN
For a potential fix...
🌟 1. Could be related to the utils/label.ts
getLabelText
function if we could add in context from the component's innerText
when label
isn't defined (possibly useful to other components which have a non-required label
prop), 🌟 recommended approach, reference Matt's note below.
innerText
, orlabel
prop on the componentI think we should probably adjust the label.ts function to no longer get the whole textContent.
Actual Behavior
We are using a
calcite-popover
with acalcite-button
as its reference element. When the button gets focus, the entire contents of the popover is read before the popover has been opened. I can see that the button in the shadow root has the entire popover contents in its aria-label.Expected Behavior
When the
calcite-button
gets focus, only the button text should be read by the screen reader. Once the button is clicked and thecalcite-popover
that it is the reference element for is opened, then the popover should be read.Reproduction Sample
https://codesandbox.io/s/calcite-button-screenreader-issue-3tcvow?file=/src/App.js
Reproduction Steps
calcite-button
that reads 'Any age groups'calcite-button
element and the shadow-root if not already expandedbutton
element has all of thecalcite-popover
content in its aria-labelReproduction Version
0.35.0
Relevant Info
Windows 10, Chrome 107.0.5304.107
Regression?
No response
Impact
@driskull suggested a workaround (setting the label property on the
calcite-button
) that gets us past this issue, so it is not blocking any work.Esri team
Professional Services - Midwest Delivery Center