Commit 72bcf9f3 authored by Isabella Scalzi's avatar Isabella Scalzi Committed by Commit Bot

[quickview] Disable image focus activation

If the user click on an image in the Quick View content area, the
the files-safe-media webview takes the focus. However, there are no
focusable elements inside the image. Blur them and put the focus back
to the quick view dialog element.

No-try: true
Test: Test coming
Bug: 1038835
Change-Id: I775122bd04397843941b078336c6fe09cf70f873
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067839Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Commit-Queue: Isabella Scalzi <isabellascalzi@google.com>
Cr-Commit-Position: refs/heads/master@{#743433}
parent fd367fab
...@@ -53,6 +53,7 @@ const FilesQuickView = Polymer({ ...@@ -53,6 +53,7 @@ const FilesQuickView = Polymer({
}, },
listeners: { listeners: {
'files-safe-media-tap-inside': 'tapInside',
'files-safe-media-tap-outside': 'close', 'files-safe-media-tap-outside': 'close',
'files-safe-media-load-error': 'loaderror', 'files-safe-media-load-error': 'loaderror',
}, },
...@@ -130,6 +131,13 @@ const FilesQuickView = Polymer({ ...@@ -130,6 +131,13 @@ const FilesQuickView = Polymer({
} }
}, },
tapInside: function(e) {
if (this.type === 'image') {
const dialog = this.shadowRoot.querySelector('#dialog');
dialog.focus();
}
},
/** /**
* @return {!FilesMetadataBox} * @return {!FilesMetadataBox}
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment