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

unify offcanvas keydown event logic with modal #38025

Merged
merged 2 commits into from
Feb 11, 2023

Conversation

Ronid1
Copy link
Contributor

@Ronid1 Ronid1 commented Feb 8, 2023

Description

Since the offcanvas keydown event listener behaves like the modal keydown listener, the former was refactored like the modal. Making it more readable by using positive conditions instead of negative ones.

Motivation & Context

To make refactor and bugfix separated, a new PR was opened as discussed in this comment.

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

N/A

Related issues

Splited from #37968

js/src/offcanvas.js Outdated Show resolved Hide resolved
@Ronid1
Copy link
Contributor Author

Ronid1 commented Feb 8, 2023

@GeoSot updated according to your review. Rebased and squashed.

@XhmikosR XhmikosR changed the title unify offcanvas keydown event logic with modal unify offcanvas keydown event logic with modal Feb 9, 2023
@GeoSot
Copy link
Member

GeoSot commented Feb 10, 2023

It looks fin to my eyes.
Either way, we didn't have to use event.preventDefault() and was not tested too

note: I suppose we don't need any tests for this

@julien-deramond julien-deramond merged commit 7432ebc into twbs:main Feb 11, 2023
@mahilanmjd mahilanmjd mentioned this pull request Apr 16, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants