Byteclaw / visage

Visage design system
https://visage.design
MIT License
12 stars 3 forks source link

Probably bug when closing dialog using keyboard and input is focused inside #709

Open michalkvasnicak opened 3 years ago

michalkvasnicak commented 3 years ago

If dialog with input is open and input is focused using focusElementRef and then Esc is pressed, page is scrolled down.

michalkvasnicak commented 3 years ago

This seems to be caused by autofocus on mount. Basically we should check if the dialog is open and focus the element only if dialog is open. This should be fixed by passing open to focus arg.

The issue isn't happening if the input if we click into the focused input or type in something.