Skip to content

Updated Toolbar Plugin to Add keyboard shortcut for adding hyperlinks - #4413

Merged
zurfyx merged 2 commits into
meta:mainfrom
AnuragBalhra:add-cmd-K-shortcut
May 1, 2023
Merged

zurfyx merged 2 commits into
meta:mainfrom
AnuragBalhra:add-cmd-K-shortcut

Conversation

@AnuragBalhra

Copy link
Copy Markdown
Contributor

Fix for Issue #4347

Registered new event listener in Toolbar plugin to insert link using TOGGLE_LINK_COMMAND when we press Cmd/Ctrl + K

This is my first contribution in the repo so not sure if I did it the right way.

@vercel

vercel Bot commented Apr 26, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 26, 2023 11:52pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 26, 2023 11:52pm

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Hi @AnuragBalhra!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 26, 2023
@affvalente

Copy link
Copy Markdown

When I press Ctrl+K on windows this change opens the browser's search bar, rather than Lexical's link edit box

setIsEditable(editable);
}),
activeEditor.registerRootListener((rootElement) => {
if (rootElement) {

@fantactuka fantactuka Apr 26, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use KEY_MODIFIER_COMMAND handler to be called on KEY_DOWN if any of meta/ctr/alt are pressed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really appriciate the suggestion.
I've updated the changes to use KEY_MODIFIER_COMMAND command handler.

@AnuragBalhra

Copy link
Copy Markdown
Contributor Author

@affvalente Just curious how do other contributors test their changes on different os platforms? I just have Mac. Should I install VM for win?

@fantactuka

Copy link
Copy Markdown
Contributor

@affvalente Just curious how do other contributors test their changes on different os platforms? I just have Mac. Should I install VM for win?

e2e tests would run on all platforms, as it's pretty hard to have all of them available to test locally. That said, I think it should work fine now with preventDefault()

@fantactuka fantactuka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@zurfyx zurfyx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM! Please have a look into #4439 if you have some time, some small nits but the UX would improve greatly!

@zurfyx
zurfyx merged commit a9a2a09 into meta:main May 1, 2023
This was referenced May 23, 2023

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 24f7b781 Deployed Apr 26, 2023 by vercel[bot]
Preview – lexical — 24f7b781 Deployed Apr 26, 2023 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants