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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Checkbox] Fix shift click #11810

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/funny-timers-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Fixed Shift + click selection of `IndexTable.Row` not working in Firefox
8 changes: 6 additions & 2 deletions polaris-react/src/components/Checkbox/Checkbox.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@

/* stylelint-disable selector-max-specificity, selector-max-class, selector-max-combinators, max-nesting-depth -- Much easier to read the rules when written like this */
.Input {
/* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */
@mixin visually-hidden;
position: absolute;
z-index: var(--p-z-index-1);
width: 100%;
height: 100%;
opacity: 0;
margin: 0;

&:focus-visible {
+ .Backdrop {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const Checkbox = memo(function Checkbox({
const {resourceName} = useIndexValue();
const {itemId, selected, disabled, onInteraction} = useContext(RowContext);

const wrapperClassName = classNames(styles.Wrapper);
const label = accessibilityLabel
? accessibilityLabel
: i18n.translate('Polaris.IndexTable.selectItem', {
Expand All @@ -33,11 +32,7 @@ export const Checkbox = memo(function Checkbox({
return (
<CheckboxWrapper>
<div className={styles.TableCellContentContainer}>
<div
className={wrapperClassName}
onClick={onInteraction}
onKeyUp={noop}
>
<div className={styles.Wrapper} onClick={onInteraction} onKeyUp={noop}>
<PolarisCheckbox
id={`Select-${itemId}`}
label={label}
Expand Down