-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FE Delete & Rename shortcut keys #4976
Conversation
✅ Deploy Preview for remixproject ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funtionality wise it looks fine
@@ -97,6 +101,98 @@ export const FileExplorer = (props: FileExplorerProps) => { | |||
} | |||
}, [treeRef.current]) | |||
|
|||
useEffect(() => { | |||
const performDeleteion = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in Deleteion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
} | ||
} | ||
} | ||
const deleteKeyPressUpHandler = async (eve: KeyboardEvent) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to add listeners for both keyup
& keydown
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the keyUp updates the state variable for deleteKey and F2Key
setState((prevState) => { | ||
return { ...prevState, deleteKey: false } | ||
}) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should performDeleteion()
be called here too?
@@ -357,6 +453,7 @@ export const FileExplorer = (props: FileExplorerProps) => { | |||
} | |||
|
|||
const handleTreeClick = (event: SyntheticEvent) => { | |||
console.log({ props, state }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove log
if (treeRef.current) { | ||
const deleteKeyPressHandler = async (eve: KeyboardEvent) => { | ||
if (eve.key === 'Delete' ) { | ||
(window as any)._paq.push(['trackEvent', 'fileExplorer', 'deleteKey']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will be better to create a variable for (window as any)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also _paq.push
takes 4 args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fixes #258