Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix: make prev and next slides not focusable and aria-hidden #2116

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 71 additions & 57 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,65 +113,75 @@

<div class="viewer__content" :class="contentClass" @click.self.exact="close">
<!-- COMPARE FILE -->
<component :is="comparisonFile.modal"
v-if="comparisonFile && !comparisonFile.failed && showComparison"
:key="comparisonFile | uniqueKey"
ref="comparison-content"
v-bind="comparisonFile"
:active="true"
:can-swipe="false"
:can-zoom="false"
:editing="false"
:is-full-screen="isFullscreen"
:is-sidebar-shown="isSidebarShown"
:loaded.sync="comparisonFile.loaded"
class="viewer__file viewer__file--active"
@error="comparisonFailed" />
<div v-if="comparisonFile && !comparisonFile.failed && showComparison" class="viewer__file-wrapper">
<component :is="comparisonFile.modal"
:key="comparisonFile | uniqueKey"
ref="comparison-content"
v-bind="comparisonFile"
:active="true"
:can-swipe="false"
:can-zoom="false"
:editing="false"
:is-full-screen="isFullscreen"
:is-sidebar-shown="isSidebarShown"
:loaded.sync="comparisonFile.loaded"
class="viewer__file viewer__file--active"
@error="comparisonFailed" />
</div>

<!-- PREVIOUS -->
<component :is="previousFile.modal"
v-if="previousFile && !previousFile.failed"
<div v-if="previousFile"
:key="previousFile | uniqueKey"
ref="previous-content"
v-bind="previousFile"
:file-list="fileList"
class="viewer__file--hidden viewer__file"
@error="previousFailed" />
<Error v-else-if="previousFile"
class="hidden-visually"
:name="previousFile.basename" />
class="viewer__file-wrapper viewer__file-wrapper--hidden"
aria-hidden="true"
inert>
<component :is="previousFile.modal"
v-if="!previousFile.failed"
ref="previous-content"
v-bind="previousFile"
:file-list="fileList"
class="viewer__file"
@error="previousFailed" />
<Error v-else
:name="previousFile.basename" />
</div>

<!-- CURRENT -->
<component :is="currentFile.modal"
v-if="!currentFile.failed"
:key="currentFile | uniqueKey"
ref="content"
v-bind="currentFile"
:active="true"
:can-swipe.sync="canSwipe"
:can-zoom="canZoom"
:editing.sync="editing"
:file-list="fileList"
:is-full-screen="isFullscreen"
:is-sidebar-shown="isSidebarShown"
:loaded.sync="currentFile.loaded"
class="viewer__file viewer__file--active"
@error="currentFailed" />
<Error v-else
:name="currentFile.basename" />
<div :key="currentFile | uniqueKey" class="viewer__file-wrapper">
<component :is="currentFile.modal"
v-if="!currentFile.failed"
ref="content"
v-bind="currentFile"
:active="true"
:can-swipe.sync="canSwipe"
:can-zoom="canZoom"
:editing.sync="editing"
:file-list="fileList"
:is-full-screen="isFullscreen"
:is-sidebar-shown="isSidebarShown"
:loaded.sync="currentFile.loaded"
class="viewer__file viewer__file--active"
@error="currentFailed" />
<Error v-else
:name="currentFile.basename" />
</div>

<!-- NEXT -->
<component :is="nextFile.modal"
v-if="nextFile && !nextFile.failed"
<div v-if="nextFile"
:key="nextFile | uniqueKey"
ref="next-content"
v-bind="nextFile"
:file-list="fileList"
class="viewer__file--hidden viewer__file"
@error="nextFailed" />
<Error v-else-if="nextFile"
class="hidden-visually"
:name="nextFile.basename" />
class="viewer__file-wrapper viewer__file-wrapper--hidden"
aria-hidden="true"
inert>
<component :is="nextFile.modal"
v-if="!nextFile.failed"
ref="next-content"
v-bind="nextFile"
:file-list="fileList"
class="viewer__file"
@error="nextFailed" />
<Error v-else
:name="nextFile.basename" />
</div>
</div>
</NcModal>
</template>
Expand Down Expand Up @@ -1231,17 +1241,16 @@ export default {
}

&__content {
// center views
width: 100%;
height: 100%;
}

&__file-wrapper {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}

&__file {
transition: height 100ms ease,
width 100ms ease;

// display on page but make it invisible
&--hidden {
Expand All @@ -1251,6 +1260,11 @@ export default {
}
}

&__file {
transition: height 100ms ease,
width 100ms ease;
}

&.theme--dark:deep(.button-vue--vue-tertiary) {
&:hover {
background-color: rgba(255, 255, 255, .08) !important;
Expand Down
Loading