Skip to content

Commit 1b087f7

Browse files
committed
Merge pull request #53 from AnastasiaBuniakEPAM/JS-255
JS-324: Fix thumb-arrow tabindex
2 parents bb8f918 + 4992a2d commit 1b087f7

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

lib/web/fotorama/fotorama.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,13 @@ fotoramaVersion = '4.6.4';
11911191
return !!el.getAttribute('disabled');
11921192
}
11931193

1194-
function disableAttr(FLAG) {
1195-
return {tabindex: FLAG * -1 + '', disabled: FLAG};
1194+
function disableAttr(FLAG, disable) {
1195+
if (disable) {
1196+
return {disabled: FLAG};
1197+
} else {
1198+
return {tabindex: FLAG * -1 + '', disabled: FLAG};
1199+
1200+
}
11961201
}
11971202

11981203
function addEnterUp(el, fn) {
@@ -2613,10 +2618,10 @@ fotoramaVersion = '4.6.4';
26132618
disableNext = disableDirrection(1);
26142619
$arrPrev
26152620
.toggleClass(arrDisabledClass, disablePrev)
2616-
.attr(disableAttr(disablePrev));
2621+
.attr(disableAttr(disablePrev, false));
26172622
$arrNext
26182623
.toggleClass(arrDisabledClass, disableNext)
2619-
.attr(disableAttr(disableNext));
2624+
.attr(disableAttr(disableNext, false));
26202625
}
26212626

26222627
function thumbArrUpdate() {
@@ -2633,10 +2638,10 @@ fotoramaVersion = '4.6.4';
26332638
}
26342639
$thumbArrLeft
26352640
.toggleClass(arrDisabledClass, isLeftDisable)
2636-
.attr(disableAttr(isLeftDisable));
2641+
.attr(disableAttr(isLeftDisable, true));
26372642
$thumbArrRight
26382643
.toggleClass(arrDisabledClass, isRightDisable)
2639-
.attr(disableAttr(isRightDisable));
2644+
.attr(disableAttr(isRightDisable, true));
26402645
}
26412646

26422647
function stageWheelUpdate() {

lib/web/mage/gallery/gallery.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<div class="fotorama__nav-wrap" data-gallery-role="nav-wrap">
2626
<div class="fotorama__nav fotorama__nav--thumbs">
2727
<div class="fotorama__fullscreen-icon" data-gallery-role="fotorama__fullscreen-icon" tabindex="0" aria-label="Exit fullscreen" role="button"></div>
28-
<div class="fotorama__thumb__arr fotorama__thumb__arr--left" role="button" aria-label="Previos" data-gallery-role="arrow">
28+
<div class="fotorama__thumb__arr fotorama__thumb__arr--left" role="button" aria-label="Previos" data-gallery-role="arrow" tabindex = "-1">
2929
<div class="fotorama__thumb--icon"></div>
3030
</div>
3131
<div class="fotorama__nav__shaft">
3232
<div class="fotorama__thumb-border"></div>
3333
</div>
34-
<div class="fotorama__thumb__arr fotorama__thumb__arr--right" role="button" aria-label="Next" data-gallery-role="arrow">
34+
<div class="fotorama__thumb__arr fotorama__thumb__arr--right" role="button" aria-label="Next" data-gallery-role="arrow" tabindex = "-1">
3535
<div class="fotorama__thumb--icon"></div>
3636
</div>
3737
</div>

lib/web/mage/gallery/module/_focus.less

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
.fotorama__zoom-out:focus,
88
.fotorama__zoom-in:focus,
99
.fotorama__arr:focus,
10-
.fotorama__arr:focus,
1110
.fotorama__stage__shaft:focus,
1211
.fotorama__nav__frame--thumb:focus .fotorama__thumb,
1312
.fotorama__nav__frame--dot:focus .fotorama__dot {
@@ -59,4 +58,9 @@
5958
.fotorama__thumb.fotorama_vertical_ratio:after{
6059
bottom: 1px;
6160
}
62-
}
61+
}
62+
63+
.fotorama__thumb__arr {
64+
box-shadow: none;
65+
}
66+

0 commit comments

Comments
 (0)