Adaverse commented on code in PR #30950:
URL: https://github.com/apache/airflow/pull/30950#discussion_r1204940812
##########
airflow/www/static/js/dag/details/NotesAccordion.tsx:
##########
@@ -106,8 +160,16 @@ const NotesAccordion = ({
maxRows={10}
as={ResizeTextarea}
value={note}
- onChange={(e) => setNote(e.target.value)}
+ onChange={(e) => {
+ setNote(e.target.value);
+ }}
data-testid="notes-input"
+ onFocus={() => {
+ localStorage.setItem(isInputIFocus, "true");
Review Comment:
As mentioned
[here](https://github.com/apache/airflow/pull/30950#issuecomment-1553315956),
no matter what I use, the events still end up bubbling when the user is typing
in the notes text box. So, for example, if the user, while typing in the notes
textbox presses `shift + C` ( to get capital C ), it fires up the corresponding
shortcut as well. Hence, in order to avoid triggering the shortcut, we are
using this LocalStorage to identify whether the user is typing or not at any
given moment [in this
line](https://github.com/apache/airflow/blob/275d4a226a3059bd50b5ae6417a2d4f506c5ae1f/airflow/www/static/js/utils/useKeysPress.ts#L43).
If yes, then we will ignore the event to trigger a shortcut, or if no, then
otherwise. And onBlur, we are setting it to false.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]