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

prevent certain keyboard shortcuts causing all work to be lost #10118

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

k-yle
Copy link
Collaborator

@k-yle k-yle commented Feb 22, 2024

Closes #9398, Closes #10593

Currently, if you press 1, 2, 3, or N while drawing a way, all your hard work is lost :(

This PR allows modes to specify when they are disabled, which is already possible for actions.

The modes for adding a point/line/area/note are now disabled if you are in a drawing mode.

Copy link
Member

@tyrasd tyrasd left a comment

Choose a reason for hiding this comment

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

To make this for also work for the N keyboard shortcut, the is-disabled test needs to be performed in modules/ui/notes.js (line 37+) as well:

    context.keybinding().on(mode.key, function() {
        if (!enabled()) return;
        if (mode.disabled?.()) return;

Closes #10593

I cannot confirm this: neither the click of the commit button nor the Ctrl+S keyboard shortcut are disabled while drawing. Did you mean to link this issue to a different PR?

@tyrasd tyrasd added the usability An issue with ease-of-use or design label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability An issue with ease-of-use or design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unfinished line or area lost when accidentally pressing save Shortcut 2 disaster
2 participants