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

fix: LSDV-5482: Fix autocomplete Escape in modal #4692

Merged
merged 3 commits into from Aug 25, 2023

Conversation

hlomzik
Copy link
Collaborator

@hlomzik hlomzik commented Aug 25, 2023

Don't close modal when Escape is pressed during config editing.

This switches Create Project modal's escape handler from capture to bubble event phase.

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

(check all that apply)

  • Product design
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

New UX behaviour appeared after adding autocomplete:
there is a popup with hints in config editor now, and this popup can be closed by pressing Escape, but if editor is in Create Project modal this will close the entire modal, removing project draft and erasing everything added there.

What does this fix?

Don't close modal if editor is focused.

Does this PR introduce a breaking change?

(check only one)

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

(check all that apply)

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

Config Editor, Autocomplete, Modal

Don't close modal when Escape is pressed during config editing.

This switches modal's escape handlers from capture to bubble event phase.
@netlify
Copy link

netlify bot commented Aug 25, 2023

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 4ced775
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/64e9092ad6632700087e0ceb

@netlify
Copy link

netlify bot commented Aug 25, 2023

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 4ced775
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/64e9092a13b30c00079384e3

@github-actions github-actions bot added the fix label Aug 25, 2023
@hlomzik hlomzik enabled auto-merge (squash) August 25, 2023 20:03
@hlomzik hlomzik merged commit 03c07b4 into develop Aug 25, 2023
26 checks passed
@hlomzik hlomzik deleted the fb-lsdv-5482/escape-in-modal branch August 28, 2023 17:01
shayantabatabaee pushed a commit to shayantabatabaee/label-studio that referenced this pull request Sep 19, 2023
* fix: LSDV-5482: Fix autocomplete Escape in modal

Don't close modal when Escape is pressed during config editing.

This switches Create Project modal's escape handler from capture to bubble event phase.

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/5975239509

---------

Co-authored-by: robot-ci-heartex <robot-ci-heartex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants