Closed wkillerud closed 3 years ago
Hey, I'll look into this and get back to you with regards to a PR. Thanks for the heads-up!
Nice, thank you! And good to see a familiar face 😄 Let me know if I can help.
@wkillerud reckon you could give it a try with @nrk/core-toggle@3.1.0?
Looks like the jsx -file published through npm for @nrk/core-toggle@3.0.8 sets aria-label prior to target being updated. This was fixed in 0a3473 but not released. The correct order has been released as part of core-toggle@3.1.0
Hopefully this should resolve your issue without the need to use label
instead of textContent
, but give me a shout if I've missed something
Can confirm 3.1.0
sets the correct aria-label
on our end while still reading from textContent
🎉 @skjalgepalg
I wanted to run an issue I'm seeing in
@nrk/core-toggle
by y'all. We're using the React wrapper in fremtind/jokul for our Select component. Because of a timing issue,aria-label
is being set to include the value of the previously selected item instead of the currently selected.The PR fremtind/jokul#2190 provides more context and a video from a debugging session.
What it boils down to is the source of the
aria-label
value and the timing at whicharia-label
is set. Our implementation ended up calling this setter before our React-component had a chance to render with an updated value forbutton.textContent
.Is the below patch of interest upstream? 😄 If so I can open a PR.