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 #2431: re-register key bindings on subsequent lightbox opens #2432

Conversation

gracemarsh
Copy link
Contributor

@gracemarsh gracemarsh commented Oct 1, 2022

Description

Corrects a bug introduced by #2258 which unregistered the keyboard event listeners on close, but does not correctly re-register the event listeners on subsequent lightbox opens.

Issue

Lightbox keyboard shortcuts not working after lightbox is closed. #2431

Types of changes

Bug fix (non-breaking change which fixes an issue)

How has this been tested?

This is a suggestion and has NOT been run let alone tested.
Please feel free to discard this PR and implement a real fix with tests.

Acceptance criteria

  • The lightbox keyboard shortcuts work as expected regardless of the number of times the lightbox has been opened and closed.

Checklist:

  • My code is tested
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request

@gracemarsh gracemarsh changed the title fix #2431: lightbox key bindings re-registering on subsequent opens. fix #2431: re-register key bindings on subsequent lightbox opens Oct 1, 2022
@AnthonyLedesma
Copy link
Member

@gracemarsh Thanks for taking the time to fix this bug and submit the PR. I went ahead and pushed up a minor change here that will ensure the logic is properly applied to the initial state. Since the default display value of the wrapper can be '' as well as 'none' I reversed the logic to say wrapper.style.display !== 'flex' then LB is closed. Also minor spaces fixes I think its tabs vs spaces or something.

Copy link
Member

@AnthonyLedesma AnthonyLedesma left a comment

Choose a reason for hiding this comment

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

LGTM

@AnthonyLedesma AnthonyLedesma merged commit 96da572 into godaddy-wordpress:master Oct 3, 2022
@olafleur-godaddy olafleur-godaddy added this to the Next Release milestone Nov 3, 2022
@olafleur-godaddy
Copy link
Member

This fix was released in CoBlocks 2.25.0 today. Thanks a lot for your contribution @gracemarsh !
I've added you to the list of contributors : https://github.com/godaddy-wordpress/coblocks/blob/master/CONTRIBUTORS.md

EvanHerman added a commit that referenced this pull request Nov 7, 2022
* fix #2431: re-register key bindings on subsequent lightbox opens (#2432)

* fix #2431: lightbox key bindings

* tweak logic and spacing

Co-authored-by: AnthonyLedesma <anthonymledesma@gmail.com>

* [skip ci] Update coblocks.pot/coblocks.json files

* Updates

* update .sql file

* Updates

* Update aria labels

* Updates to slider

* Update unit tests

* Add ignore element

* Add wait beore running pa11y

* Update .sql file

* updates

* Remove alert

* Try pa11y-ci

* Test new config

* update

* Wait for element

* Update actions

* Test screenshot before pa11y

* Fix path

* Fix artifact path

* Increase timeout

* Move images to uploads directory

* Tweak media path

* Rename coblocks-testing

* Try pa11y

* Update pa11y.js

* Fix test url

* Remove pa11y-ci

* Update pa11y sql test file

* Update site title and tagline of a11y test site

* Install go theme before performance tests run

* Install go theme before performance tests run

* remove go theme before performance tests run

* Update form cypress test

* Update form cypress test

* Update service block test

* Remove checkbox from color test

* Fix form legend style attributes

* Add test for form legend color

* Update eslint errors/warnings

* Update color label test

* Update collage and carousel snapshots

* Update form tests

* Update

* Update

* Fix form tests

* Test

* Update color

* Update pricing table test

* Update service cypress test

* Revert

* Update helpers add custom class, update service cypress test.

* Uncomment test

* Fix js errors

* Fix broken tests with WP 6.1 RC1 (#2435)

* Fix broken tests in Accordion block in WP 6.1 RC1

* Other fixes

* Fix condition

* Permalink is not at the same place in WP 6.1

* Type caption in Gallery Collage

* Fix Pricing Table Item test

* Fix padding-controls test

* Fix Food & Drink block tests

* Do not execute Form tests that need a CI setup when in local

* Fix Form block test

* Fix Food Item block tests

* Fix Icon block test

* Fix Gallery Masonry block test

* Code review fixes

* [skip ci] Update coblocks.pot/coblocks.json files

* Fix collage replace image caption save bug

* Add WCAG2A badge to readme.md

* Fix conditional to determine if we are using a WP version >= WP 6.1 in the tests (#2437)

Fix conditional

* [skip ci] Update coblocks.pot/coblocks.json files

* Drop support for PHP 5.6 (#2408)

* Drop PHP 5.6

* Update wp-phpunit

* Drop --1

* composer update

* Revert skip coverage for PHP 8.1

* Fix spacing

* Rollback --1

* Put back newPhpUnit flag

* Augment PHP version to 7.4+ in phpcs.xml

* [skip ci] Update coblocks.pot/coblocks.json files

* Disable color controls for WordPress 6.1+ (#2440)

* disable color settings controls in 6.1+ WP

* Skip Cypress tests for Color Controls for WP 6.1+

Co-authored-by: Anthony M Ledesma <aledesma@LM-H7V42D79VD.lan>
Co-authored-by: Olivier Lafleur <olafleur@godaddy.com>

* [skip ci] Update coblocks.pot/coblocks.json files

* Bump 'Tested up to' to WP 6.1 (#2439)

* [skip ci] Update coblocks.pot/coblocks.json files

* Make sure that the Welcome Guide does not show in the Cypress tests (#2441)

* It should work

* Code Review changes

* [skip ci] Update coblocks.pot/coblocks.json files

* Fix aria label for email field. Remove migrate heading level from food and drink item.

* Remove ID attributes from next and prev buttons

* Update GoDaddy Styles to 1.0.5 (#2438)

* [skip ci] Update coblocks.pot/coblocks.json files

* Changelog for 2.25.0

* 2.25.0

* [skip ci] Update coblocks.pot/coblocks.json files

* Add @gracemarsh to the contributors

* [skip ci] Update coblocks.pot/coblocks.json files

* Fix extra }

* Update email field aria label capitalization

Co-authored-by: Grace <62684655+gracemarsh@users.noreply.github.com>
Co-authored-by: AnthonyLedesma <anthonymledesma@gmail.com>
Co-authored-by: GoDaddy Translator Bot <plugins@godaddy.com>
Co-authored-by: Olivier Lafleur <85255688+olafleur-godaddy@users.noreply.github.com>
Co-authored-by: Anthony Ledesma <30462574+AnthonyLedesma@users.noreply.github.com>
Co-authored-by: Anthony M Ledesma <aledesma@LM-H7V42D79VD.lan>
Co-authored-by: Olivier Lafleur <olafleur@godaddy.com>
EvanHerman added a commit that referenced this pull request Nov 10, 2022
* Enable a11y testing on CircleCI.

* pa11y Updates (#2434)

* fix #2431: re-register key bindings on subsequent lightbox opens (#2432)

* fix #2431: lightbox key bindings

* tweak logic and spacing

Co-authored-by: AnthonyLedesma <anthonymledesma@gmail.com>

* [skip ci] Update coblocks.pot/coblocks.json files

* Updates

* update .sql file

* Updates

* Update aria labels

* Updates to slider

* Update unit tests

* Add ignore element

* Add wait beore running pa11y

* Update .sql file

* updates

* Remove alert

* Try pa11y-ci

* Test new config

* update

* Wait for element

* Update actions

* Test screenshot before pa11y

* Fix path

* Fix artifact path

* Increase timeout

* Move images to uploads directory

* Tweak media path

* Rename coblocks-testing

* Try pa11y

* Update pa11y.js

* Fix test url

* Remove pa11y-ci

* Update pa11y sql test file

* Update site title and tagline of a11y test site

* Install go theme before performance tests run

* Install go theme before performance tests run

* remove go theme before performance tests run

* Update form cypress test

* Update form cypress test

* Update service block test

* Remove checkbox from color test

* Fix form legend style attributes

* Add test for form legend color

* Update eslint errors/warnings

* Update color label test

* Update collage and carousel snapshots

* Update form tests

* Update

* Update

* Fix form tests

* Test

* Update color

* Update pricing table test

* Update service cypress test

* Revert

* Update helpers add custom class, update service cypress test.

* Uncomment test

* Fix js errors

* Fix broken tests with WP 6.1 RC1 (#2435)

* Fix broken tests in Accordion block in WP 6.1 RC1

* Other fixes

* Fix condition

* Permalink is not at the same place in WP 6.1

* Type caption in Gallery Collage

* Fix Pricing Table Item test

* Fix padding-controls test

* Fix Food & Drink block tests

* Do not execute Form tests that need a CI setup when in local

* Fix Form block test

* Fix Food Item block tests

* Fix Icon block test

* Fix Gallery Masonry block test

* Code review fixes

* [skip ci] Update coblocks.pot/coblocks.json files

* Fix collage replace image caption save bug

* Add WCAG2A badge to readme.md

* Fix conditional to determine if we are using a WP version >= WP 6.1 in the tests (#2437)

Fix conditional

* [skip ci] Update coblocks.pot/coblocks.json files

* Drop support for PHP 5.6 (#2408)

* Drop PHP 5.6

* Update wp-phpunit

* Drop --1

* composer update

* Revert skip coverage for PHP 8.1

* Fix spacing

* Rollback --1

* Put back newPhpUnit flag

* Augment PHP version to 7.4+ in phpcs.xml

* [skip ci] Update coblocks.pot/coblocks.json files

* Disable color controls for WordPress 6.1+ (#2440)

* disable color settings controls in 6.1+ WP

* Skip Cypress tests for Color Controls for WP 6.1+

Co-authored-by: Anthony M Ledesma <aledesma@LM-H7V42D79VD.lan>
Co-authored-by: Olivier Lafleur <olafleur@godaddy.com>

* [skip ci] Update coblocks.pot/coblocks.json files

* Bump 'Tested up to' to WP 6.1 (#2439)

* [skip ci] Update coblocks.pot/coblocks.json files

* Make sure that the Welcome Guide does not show in the Cypress tests (#2441)

* It should work

* Code Review changes

* [skip ci] Update coblocks.pot/coblocks.json files

* Fix aria label for email field. Remove migrate heading level from food and drink item.

* Remove ID attributes from next and prev buttons

* Update GoDaddy Styles to 1.0.5 (#2438)

* [skip ci] Update coblocks.pot/coblocks.json files

* Changelog for 2.25.0

* 2.25.0

* [skip ci] Update coblocks.pot/coblocks.json files

* Add @gracemarsh to the contributors

* [skip ci] Update coblocks.pot/coblocks.json files

* Fix extra }

* Update email field aria label capitalization

Co-authored-by: Grace <62684655+gracemarsh@users.noreply.github.com>
Co-authored-by: AnthonyLedesma <anthonymledesma@gmail.com>
Co-authored-by: GoDaddy Translator Bot <plugins@godaddy.com>
Co-authored-by: Olivier Lafleur <85255688+olafleur-godaddy@users.noreply.github.com>
Co-authored-by: Anthony Ledesma <30462574+AnthonyLedesma@users.noreply.github.com>
Co-authored-by: Anthony M Ledesma <aledesma@LM-H7V42D79VD.lan>
Co-authored-by: Olivier Lafleur <olafleur@godaddy.com>

* Reinstall composer dependencies

* Remove composer install step from a11y

Co-authored-by: Justin Kopepasah <justin@kopepasah.com>
Co-authored-by: Evan Herman <evan.m.herman@gmail.com>
Co-authored-by: Grace <62684655+gracemarsh@users.noreply.github.com>
Co-authored-by: AnthonyLedesma <anthonymledesma@gmail.com>
Co-authored-by: GoDaddy Translator Bot <plugins@godaddy.com>
Co-authored-by: Olivier Lafleur <85255688+olafleur-godaddy@users.noreply.github.com>
Co-authored-by: Anthony Ledesma <30462574+AnthonyLedesma@users.noreply.github.com>
Co-authored-by: Anthony M Ledesma <aledesma@LM-H7V42D79VD.lan>
Co-authored-by: Olivier Lafleur <olafleur@godaddy.com>
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.

3 participants