Closed FelixGirard closed 1 year ago
Hey @FelixGirard, I'm not sure I understand why you would expect our Input to behave differently from the native browser input. If you want this more often than not, then you could create a wrapper over our input that calls stopPropagation
and reuse it everywhere.
I would expect it to behave differently because I guess most of the use of the component is with an open iTwin Viewer. I wish there was at least an option for that in the component, to not force each team working in widgets to create their own.
I think it might make more sense for iTwin Viewer shortcuts handling to take into account for what element is focused. I don't think iTwinUI, as a generic component library, should handle these specific things. Our Input is meant to be used across all kinds of applications, not just iTwin Viewer, and someone else might rely on the propagation behavior.
Describe the bug (actual behavior)
When entering text in an Input, it may activate a tool in the active viewer (if one is open). For example, if I search 'e' in the Tree View, the rotation tool activate:
Expected behavior
By default, I would expect an Input to stop the propagation of the event.
Reproduction
Link to a minimal repro:
Steps to reproduce
Additional information
I know I can provide functions that stop the event propagation. I think it could cause confusion for anyone working in widgets, and that we probably want this more often than not.