Fix tests for Safari
Keyboard events do not always have path data when fired on unattached elements in Safari. Bug: issue 6509 Change-Id: Ic7ec579d6d6c806b0df305db4bc1ea8ad14ca6f1
This commit is contained in:
@@ -42,10 +42,11 @@ limitations under the License.
|
||||
|
||||
shouldSuppressKeyboardShortcut(e) {
|
||||
e = getKeyboardEvent(e);
|
||||
if (e.path[0].tagName === 'INPUT' || e.path[0].tagName === 'TEXTAREA') {
|
||||
const tagName = e.target.tagName;
|
||||
if (tagName === 'INPUT' || tagName === 'TEXTAREA') {
|
||||
return true;
|
||||
}
|
||||
for (let i = 0; i < e.path.length; i++) {
|
||||
for (let i = 0; e.path && i < e.path.length; i++) {
|
||||
if (e.path[i].tagName === 'GR-OVERLAY') { return true; }
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user