Skip to content
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

Quick Reblog: Add keyboard navigation #917

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alleycatboy
Copy link
Contributor

@alleycatboy alleycatboy commented Dec 16, 2022

Description

Addresses #899.

While the popup's comment input or tag input are focused, this adds Ctrl + Enter to reblog and Escape to close the popup.

Demonstration

Ctrl + Enter to reblog in comment input field:

firefox_NfJP5vD4Qz

Ctrl + Enter to reblog in tag input field:

firefox_98xzPDs7o2

Escape to close the popup while either comment or tag field are focused:

firefox_ezE9UJohXy

Testing steps

Check the option in Quick Reblog's preferences and use Ctrl + Enter while either tag or input field are focused.

@AprilSylph AprilSylph self-requested a review January 6, 2023 20:01
event.stopPropagation();

if (enableKeyNav) {
if (event.key === 'Enter' && event.ctrlKey) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

For consistency on Macs, this should probably include metaKey as an alternative!

event.stopPropagation();

if (enableKeyNav) {
if (event.key === 'Enter' && event.ctrlKey) {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
if (event.key === 'Enter' && event.ctrlKey) {
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {

Comment on lines +74 to +78
},
"enableKeyNav": {
"type": "checkbox",
"label": "Enable keyboard navigation",
"default": true
Copy link
Owner

Choose a reason for hiding this comment

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

I don't see the need to make this a preference. Let's just build it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants