Skip to content

Commit

Permalink
Add more filters for trapping keystrokes within form fields
Browse files Browse the repository at this point in the history
  • Loading branch information
terrill committed Oct 29, 2018
1 parent 3d2863a commit 6842524
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
8 changes: 6 additions & 2 deletions build/ableplayer.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -10565,12 +10565,16 @@
which += 32;
}

// Only use keypress to control player if focus is NOT on an input field or contenteditable element
// Only use keypress to control player if focus is NOT on a form field or contenteditable element
if (!(
$(':focus').is('[contenteditable]') ||
$(':focus').is('input') ||
$(':focus').is('textarea') ||
$(':focus').is('select') ||
e.target.hasAttribute('contenteditable') ||
e.target.tagName === 'INPUT'
e.target.tagName === 'INPUT' ||
e.target.tagName === 'TEXTAREA' ||
e.target.tagName === 'SELECT'
)){
if (which === 27) { // escape
this.closePopups();
Expand Down
8 changes: 6 additions & 2 deletions build/ableplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10565,12 +10565,16 @@
which += 32;
}

// Only use keypress to control player if focus is NOT on an input field or contenteditable element
// Only use keypress to control player if focus is NOT on a form field or contenteditable element
if (!(
$(':focus').is('[contenteditable]') ||
$(':focus').is('input') ||
$(':focus').is('textarea') ||
$(':focus').is('select') ||
e.target.hasAttribute('contenteditable') ||
e.target.tagName === 'INPUT'
e.target.tagName === 'INPUT' ||
e.target.tagName === 'TEXTAREA' ||
e.target.tagName === 'SELECT'
)){
if (which === 27) { // escape
this.closePopups();
Expand Down
2 changes: 1 addition & 1 deletion build/ableplayer.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions build/ableplayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ableplayer",
"version": "3.1.16",
"version": "3.1.17",
"description": "fully accessible HTML5 media player",
"homepage": "http://ableplayer.github.io/ableplayer",
"bugs": "https://github.com/ableplayer/ableplayer/issues",
Expand Down
8 changes: 6 additions & 2 deletions scripts/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,16 @@
which += 32;
}

// Only use keypress to control player if focus is NOT on an input field or contenteditable element
// Only use keypress to control player if focus is NOT on a form field or contenteditable element
if (!(
$(':focus').is('[contenteditable]') ||
$(':focus').is('input') ||
$(':focus').is('textarea') ||
$(':focus').is('select') ||
e.target.hasAttribute('contenteditable') ||
e.target.tagName === 'INPUT'
e.target.tagName === 'INPUT' ||
e.target.tagName === 'TEXTAREA' ||
e.target.tagName === 'SELECT'
)){
if (which === 27) { // escape
this.closePopups();
Expand Down

0 comments on commit 6842524

Please sign in to comment.