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

Only enable slideout sidebar focus trap when toggled via button #11358

Merged
merged 5 commits into from
Jun 7, 2022

Conversation

gcamacho079
Copy link
Contributor

Description

There's a bug for slideouts where keyboard focus is trapped inside the details sidebar for desktop users. The focus trap should only exist for users below a certain screen size who have toggled the sidebar open via the button in the slideout header.

Resolves DEV-389

@linear
Copy link

linear bot commented May 31, 2022

DEV-389 Keyboard focus becomes trapped in Edit Element slideout sidebar details

Location: Assets edit slideout

When a user tabs into the details sidebar in the slideout, keyboard focus becomes trapped in a loop between filename input, and Preview/Edit buttons

Ensure focus is trapped between all elements in the slideout, not just those in the details sidebar

Resolves CMS-077

<div class="so-sidebar details" style="right: 0px;"><div id="onkvudaknq-thumb-container" class="preview-thumb-container button-fade checkered"><div class="preview-thumb"><img srcset="http://craft4.nitro/assets/users/_201x190_crop_center-center_none/Screen-Shot-2022-02-25-at-11.31.37-AM.png?v=1647294035 201w, http://craft4.nitro/assets/users/_402x380_crop_center-center_none/Screen-Shot-2022-02-25-at-11.31.37-AM.png?v=1647294035 402w" alt="Screen Shot 2022 02 25 at 11 31 37 AM" sizes="201px"></div><div class="buttons"><button type="button" id="onkvudaknq-preview-btn" class="btn preview-btn">Preview</button><button type="button" id="onkvudaknq-edit-btn" class="btn edit-btn">Edit</button></div></div>
<div class="meta"><div id="onkvudaknq-new-filename-field" class="field first" data-attribute="new-filename"><div class="heading"><label id="onkvudaknq-new-filename-label" for="onkvudaknq-new-filename">Filename<span class="visually-hidden">Required</span><span class="required" aria-hidden="true"></span></label></div><div class="input ltr"><input type="text" id="onkvudaknq-new-filename" class="text filename fullwidth focus-visible" name="onkvudaknq[newFilename]" value="Screen-Shot-2022-02-25-at-11.31.37-AM.png" autocomplete="off" dir="ltr" data-focus-visible-added=""></div></div></div>
<dl class="meta read-only"><div class="data"><dt class="heading">Location</dt>
<dd class="value">Users</dd>
</div>
<div class="data"><dt class="heading">File size</dt>
<dd class="value"><div id="onkvudaknq-file-size-value" title="1,195,395 bytes" aria-label="1,195,395 bytes">1 MB</div></dd>
</div>
<div class="data"><dt class="heading">Dimensions</dt>
<dd class="value"><div id="onkvudaknq-dimensions-value">1226×1158</div></dd>
</div>
<div class="data"><dt class="heading">Created at</dt>
<dd class="value">3/14/2022, 2:40 PM</dd>
</div>
<div class="data"><dt class="heading">Updated at</dt>
<dd class="value">3/14/2022, 2:42 PM</dd>
</div></dl></div>

@gcamacho079 gcamacho079 added the accessibility 👤 features related to accessibility label May 31, 2022
# Conflicts:
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
@brandonkelly brandonkelly merged commit 515437f into develop Jun 7, 2022
@brandonkelly brandonkelly deleted the hotfix/slideout-focus-trap branch June 7, 2022 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility 👤 features related to accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants