Skip to content

Commit 5860076

Browse files
committed
MC-3867: Safari - Cannot Edit, Remove, Duplicate Slide
Add tabindex to element that has focusin/focusout events bound
1 parent d6b3016 commit 5860076

File tree

3 files changed

+4
-3
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

3 files changed

+4
-3
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/slider/preview.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/template/content-type/slider/default/preview.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
each="$parent.getChildren()"
2121
data-bind="sortableChildren: { handle: '.navigation-dot-anchor', containment: 'parent', placeholder: 'navigation-dot sortable-placeholder', tolerance: 'pointer', start: onSortStart.bind($parent.preview), stop: onSortStop.bind($parent.preview) }">
2222
<div class="navigation-dot"
23+
tabindex="0"
2324
event="focusin: $parent.setFocusedSlide.bind($parent, $index(), false), focusout: $parent.onFocusOut.bind($parent)"
2425
css="active: $parent.activeSlide() === $index(), focus: $parent.focusedSlide() === $index()">
25-
<a class="navigation-dot-anchor" href="#" tabindex="0" click="$parent.onControlClick.bind($parent, $index())" hasFocus="$parent.focusedSlide() === $index()"/>
26+
<a class="navigation-dot-anchor" href="#" click="$parent.onControlClick.bind($parent, $index())" hasFocus="$parent.focusedSlide() === $index()"/>
2627
<with args="preview">
2728
<render with="preview" args="getOptions().template" />
2829
</with>

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/slider/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export default class Preview extends PreviewCollection {
177177
*/
178178
public onFocusOut(data: PreviewCollection, event: JQueryEventObject) {
179179
if (_.isNull(event.relatedTarget) ||
180-
event.relatedTarget && !$.contains(event.currentTarget as HTMLElement, event.relatedTarget)
180+
event.relatedTarget && !$(event.currentTarget as HTMLElement).closest(event.relatedTarget).length
181181
) {
182182
this.setFocusedSlide(null);
183183
}

0 commit comments

Comments
 (0)