i was trying to implement a modal and i was making the modal accessible.But i observed that when im closing the modal in NVDA with firefox it is reading as heading level1 view modal button but it should announce view modal button
Here is the modal i was trying to implement
Looks like a bug with NVDA. It happens on Chrome too. Neither JAWS nor VoiceOver re-announce the heading on the main page when the dialog is closed.
If you look at the javascript for the example, when the dialog is displayed, the element that had focus before the dialog was displayed is saved.
And when the dialog is closed, focus is moved back to that element.
Not sure why NVDA is re-announcing the main
<h1>on the main page when focus is moved back to the button. I would suggest reporting a bug to NVDA, https://github.com/nvaccess/nvda/issues