Open mxcrbn opened 1 week ago
To resolve the issue where typing in a text input field triggers shortcuts, follow these steps:
Locate the TextInput
component: This is likely where the focus handling should be adjusted.
Modify the TextInput
component to set the hotkey scope when the input field is focused. You can use the InputHotkeyScope
enum to manage this.
Example Code:
import { InputHotkeyScope } from 'path/to/InputHotkeyScope';
class TextInput extends React.Component {
handleFocus = () => {
// Set the hotkey scope to deactivate shortcuts
InputHotkeyScope.setScope('textInput');
};
handleBlur = () => {
// Revert the hotkey scope to its previous state
InputHotkeyScope.revertScope();
};
render() {
return (
<input
type="text"
onFocus={this.handleFocus}
onBlur={this.handleBlur}
{...this.props}
/>
);
}
}
InputHotkeyScope
is properly implemented to manage the scope stack and deactivate shortcuts when the scope is set to textInput
.This should prevent shortcuts from being triggered when typing in a text input field.
Bug Description
typing specific characters (eg "g") in a text field triggers shortcuts
Example:
Expected behavior
i can type my text without triggering shortcuts when focus is on text input field / can trigger shortcuts when no focus is on text input field