I have a react app, and when I was pressing enter it was triggering a hidden button, rather than the button that was showed. So I set it to disabled if hidden.
But the problem now is that "on enter" nothing happens when that button is disabled. I imagine the default behaviour is to still try to trigger the closest button on the page (regardless of if it's disabled or not).
Is there a way to alter this behaviour, or a different attribute (other than / side by side) the disabled attribute.
I know this can be done instead:
But I would prefer a cleaner way to monitoring which button should be triggered on enter at a specific time