Skip to content

Commit

Permalink
Merge 5b162a0 into ddb1e26
Browse files Browse the repository at this point in the history
  • Loading branch information
annarieger committed Feb 22, 2019
2 parents ddb1e26 + 5b162a0 commit 14ffce2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Panel/Panel/Panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Panel extends React.Component {
* @type {String}
* @private
*/
_escapeKeyboardEventKey = 'Escape';
_escapeKeyboardEventKey = 'Esc';

/**
* The properties.
Expand Down Expand Up @@ -308,11 +308,11 @@ export class Panel extends React.Component {

/**
* Called on keyboard `keydown` event. Will be only triggered if pressed key
* is `escape` key and `onEscape` function is provided via props.
* is `Escape` key and `onEscape` function is provided via props.
* @param {React.KeyboardEvent<HTMLDivElement>} evt `keydown` event.
*/
onKeyDown = evt => {
if (evt && evt.key === this._escapeKeyboardEventKey && this.props.onEscape) {
if (evt && evt.key.startsWith(this._escapeKeyboardEventKey) && this.props.onEscape) {
this.rnd.getSelfElement().focus();
this.props.onEscape();
}
Expand Down

0 comments on commit 14ffce2

Please sign in to comment.