Skip to content

unify offcanvas keydown event logic with modal#38025

Merged
julien-deramond merged 2 commits intotwbs:mainfrom
Ronid1:ronid1/offcanvas_refactor
Feb 11, 2023
Merged

unify offcanvas keydown event logic with modal#38025
julien-deramond merged 2 commits intotwbs:mainfrom
Ronid1:ronid1/offcanvas_refactor

Conversation

@Ronid1
Copy link
Copy Markdown
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

@Ronid1 Ronid1 force-pushed the ronid1/offcanvas_refactor branch from 680e046 to a34b06f Compare February 8, 2023 16:49
@Ronid1
Copy link
Copy Markdown
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 GeoSot force-pushed the ronid1/offcanvas_refactor branch from a34b06f to 7eff064 Compare February 10, 2023 19:14
@GeoSot
Copy link
Copy Markdown
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.

3 participants