-
Notifications
You must be signed in to change notification settings - Fork 242
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
feat: markdown formatting using keyboard shortcut #4058
base: main
Are you sure you want to change the base?
Conversation
@Abhi-Bohora is attempting to deploy a commit to the Daily Dev Team on Vercel. A member of the Team first needs to authorize it. |
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.
I realized one thing about our existing keydown commands, we might want to check whether they would still work and how we can incorporate the changes with it together.
@@ -317,15 +418,47 @@ export const useMarkdownInput = ({ | |||
}; | |||
|
|||
const onPaste: ClipboardEventHandler<HTMLTextAreaElement> = (e) => { | |||
if (!e.clipboardData.files?.length || !isUploadEnabled) { | |||
if (!e.clipboardData.files?.length && !isUploadEnabled) { |
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.
I had to change this to &&
because this ||
was was giving me early return and logic below can't be applied. please let me know if this breaks something, seems to work fine when i tested
@sshanzel Hy I have moved the logic in and about this lint error this seems to be coming from already existing code so i decided not to change anything...😅 |
Changes
linked Issue: 1624
The pr which I raise before which got merged caused some issue as mentioned here so this new pr aims to fix that.
This PR has all the logic implemented same as this pr and keyboard shortcuts functions the same expect for the link command we use ctrl+k now to follow common community convention as suggested. And there was a issue while pasting the content in textarea, browser would ask permission at first. now the issue should not be there, i have moved the logic to make user selected word to link, if a link is paste over a selected word to
handleLinkPaste
fn and only trigger whenonPaste
and decided not to touch default browser paste functionality.sorry for the inconvenience...😅 thanks
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR