Skip to content

Commit

Permalink
[A11y] - handle focus when esc key is pressed (#1355)
Browse files Browse the repository at this point in the history
* [A11y] - handle focus when esc key is pressed

* bump fo ci test
  • Loading branch information
Galpittel authored Feb 9, 2025
1 parent da95741 commit 2ca2deb
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 14 deletions.
6 changes: 3 additions & 3 deletions packages/blueprints/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pro-gallery-blueprints",
"version": "5.0.112",
"version": "5.0.113",
"private": false,
"author": {
"name": "Nir Naor",
Expand Down Expand Up @@ -41,8 +41,8 @@
"typescript": "^4.9.5"
},
"dependencies": {
"pro-gallery-lib": "5.0.112",
"pro-layouts": "5.0.112"
"pro-gallery-lib": "5.0.113",
"pro-layouts": "5.0.113"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand Down
6 changes: 3 additions & 3 deletions packages/gallery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"dependencies": {
"@vimeo/player": "2.8.2",
"hls.js": "1.4.12",
"pro-gallery-blueprints": "5.0.112",
"pro-gallery-lib": "5.0.112",
"pro-layouts": "5.0.112",
"pro-gallery-blueprints": "5.0.113",
"pro-gallery-lib": "5.0.113",
"pro-layouts": "5.0.113",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-player": "2.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class GalleryView extends React.Component {
);
break;
case 27: //esc
e.stopPropagation();
utils.focusGalleryElement(this.props.galleryContainerRef);
// e.stopPropagation();
// utils.focusGalleryElement(this.props.galleryContainerRef);
return false;
}

Expand Down
9 changes: 9 additions & 0 deletions packages/gallery/src/components/item/itemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,15 @@ class ItemView extends React.Component {
this.itemAnchor.click(); // when directLink, we want to simulate the 'enter' or 'space' press on an <a> element
}
return false;
case 27: //esc
// The first ESC press removes the hover effect, the second removes focus
if (this.state.isCurrentHover) {
this.props.actions.eventsListener(GALLERY_CONSTS.events.HOVER_SET, -1);
} else {
e.target.blur();
this.props.actions.eventsListener(GALLERY_CONSTS.events.ITEM_LOST_FOCUS, this.props);
}
return false;
default:
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/layouts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"name": "pro-layouts",
"sideEffects": false,
"version": "5.0.112",
"version": "5.0.113",
"author": {
"name": "Guy Sopher",
"email": "[email protected]"
Expand Down Expand Up @@ -43,6 +43,6 @@
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"pro-gallery-lib": "5.0.112"
"pro-gallery-lib": "5.0.113"
}
}
2 changes: 1 addition & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pro-gallery-lib",
"version": "5.0.112",
"version": "5.0.113",
"private": false,
"author": {
"name": "Rita Bazak",
Expand Down
6 changes: 3 additions & 3 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"lodash.clonedeep": "^4.5.0",
"moment": "2.29.2",
"pro-gallery": "5.0.113",
"pro-gallery-blueprints": "5.0.112",
"pro-gallery-lib": "5.0.112",
"pro-layouts": "5.0.112",
"pro-gallery-blueprints": "5.0.113",
"pro-gallery-lib": "5.0.113",
"pro-layouts": "5.0.113",
"re-resizable": "^6.10.3",
"react": "^18.2.0",
"react-color": "^2.17.3",
Expand Down

0 comments on commit 2ca2deb

Please sign in to comment.