Should render correctly with selectable with shift click for mul
(null)
@@ -170,23 +170,20 @@ export const Row = ({
const canClickRowToExpand = hasExpandable && !expandButton
- useEffect(() => {
- const { current } = checkboxRowRef
-
- if (current) {
- mapCheckbox.set(id, current)
- }
-
- return () => {
- mapCheckbox.delete(id)
- }
- }, [mapCheckbox, id])
-
const theme = useTheme()
const childrenLength =
Children.count(children) + (selectable ? 1 : 0) + (expandButton ? 1 : 0)
+ useEffect(() => {
+ const refAtEffectStart = refList.current
+ const { current } = checkboxRowRef
+
+ if (refAtEffectStart && current && !refAtEffectStart.includes(current)) {
+ refList.current.push(current)
+ }
+ }, [refList])
+
return (
<>
Should render correctly with selectable and shift click 1`] = `
fill: #ffebf2;
}
-.emotion-58 svg {
- padding: 0.125rem;
- outline: 1px inset #8c40ef;
- box-shadow: 0px 0px 0px 3px #8c40ef40;
- -webkit-transition: box-shadow 250ms ease,outline 250ms ease,padding 250ms ease;
- transition: box-shadow 250ms ease,outline 250ms ease,padding 250ms ease;
-}
-
-.emotion-58 svg rect {
- fill: #e5dbfd;
- stroke: #792dd4;
-}
-
.emotion-70 {
display: table-cell;
vertical-align: middle;
@@ -4162,144 +4149,6 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
text-align: left;
}
-.emotion-148 {
- position: relative;
- display: -webkit-inline-box;
- display: -webkit-inline-flex;
- display: -ms-inline-flexbox;
- display: inline-flex;
- -webkit-align-items: start;
- -webkit-box-align: start;
- -ms-flex-align: start;
- align-items: start;
- gap: 0.5rem;
-}
-
-.emotion-148 .eqr7bqq4 {
- cursor: pointer;
-}
-
-.emotion-148[aria-disabled='true'] {
- cursor: not-allowed;
- color: #b5b7bd;
-}
-
-.emotion-148[aria-disabled='true'] .eqr7bqq4 {
- cursor: not-allowed;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-16 {
- fill: #e9eaeb;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-16 .emotion-18 {
- stroke: #d9dadd;
- fill: #f3f3f4;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-14[aria-invalid="true"]:checked+.emotion-16 {
- fill: #ffd3e3;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-14[aria-invalid="true"]:checked+.emotion-16 .emotion-18 {
- stroke: #ffd3e3;
- fill: #ffd3e3;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-14[aria-invalid="true"]+.emotion-16 {
- fill: #ffebf2;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-14[aria-invalid="true"]+.emotion-16 .emotion-18 {
- stroke: #ffbbd3;
- fill: #ffebf2;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-14:checked+.emotion-16 {
- fill: #e5dbfd;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-14:checked+.emotion-16 .emotion-18 {
- stroke: #d8c5fc;
- fill: #d8c5fc;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-14[aria-checked="mixed"]+.emotion-16 {
- fill: #e5dbfd;
-}
-
-.emotion-148[aria-disabled='true'] .emotion-14[aria-checked="mixed"]+.emotion-16 .emotion-18 {
- stroke: #e5dbfd;
- fill: #e5dbfd;
-}
-
-.emotion-148 .emotion-14:checked+.emotion-16 path {
- transform-origin: center;
- -webkit-transition: 200ms -webkit-transform ease-in-out;
- transition: 200ms transform ease-in-out;
- -webkit-transform: scale(1);
- -moz-transform: scale(1);
- -ms-transform: scale(1);
- transform: scale(1);
- -webkit-transform: translate(2px, 2px);
- -moz-transform: translate(2px, 2px);
- -ms-transform: translate(2px, 2px);
- transform: translate(2px, 2px);
-}
-
-.emotion-148 .emotion-14:checked+.emotion-16 .emotion-18 {
- fill: #8c40ef;
- stroke: #8c40ef;
-}
-
-.emotion-148 .emotion-14[aria-invalid="true"]:checked+.emotion-16 .emotion-18 {
- fill: #e51963;
- stroke: #e51963;
-}
-
-.emotion-148 .emotion-14[aria-checked="mixed"]+.emotion-16 .emotion-20 {
- fill: #ffffff;
-}
-
-.emotion-148 .emotion-14[aria-checked="mixed"]+.emotion-16 .emotion-18 {
- fill: #8c40ef;
- stroke: #8c40ef;
-}
-
-.emotion-148:hover[aria-disabled='false'] .emotion-14[aria-invalid='false'][aria-checked='false']+.emotion-16 .emotion-18 {
- stroke: #792dd4;
- fill: #e5dbfd;
-}
-
-.emotion-148:hover[aria-disabled='false'] .emotion-14[aria-invalid='false'][aria-checked='true']+.emotion-16 .emotion-18 {
- stroke: #792dd4;
- fill: #792dd4;
-}
-
-.emotion-148:hover[aria-disabled='false'] .emotion-14[aria-invalid='false'][aria-checked='mixed']+.emotion-16 .emotion-18 {
- stroke: #792dd4;
- fill: #792dd4;
-}
-
-.emotion-148:hover[aria-disabled='false'] .emotion-14[aria-invalid='true'][aria-checked='false']+.emotion-16 .emotion-18 {
- stroke: #92103f;
- fill: #ffd3e3;
-}
-
-.emotion-148:hover[aria-disabled='false'] .emotion-14[aria-invalid='true'][aria-checked='true']+.emotion-16 .emotion-18 {
- stroke: #d6175c;
- fill: #d6175c;
-}
-
-.emotion-148 .emotion-14[aria-invalid="true"]+.emotion-16 {
- fill: #e51963;
-}
-
-.emotion-148 .emotion-14[aria-invalid="true"]+.emotion-16 .emotion-18 {
- stroke: #e51963;
- fill: #ffebf2;
-}
-
@@ -4705,7 +4554,7 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
>
@@ -4794,7 +4643,7 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
>
@@ -4883,7 +4732,7 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
>
@@ -4972,7 +4821,7 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
>
@@ -5061,7 +4910,7 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
>
@@ -5150,7 +4999,7 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
>
@@ -5239,7 +5088,7 @@ exports[`Table > Should render correctly with selectable and shift click 1`] = `
>
diff --git a/packages/ui/src/components/Table/__tests__/index.test.tsx b/packages/ui/src/components/Table/__tests__/index.test.tsx
index 8ccdaafabd..d820815986 100644
--- a/packages/ui/src/components/Table/__tests__/index.test.tsx
+++ b/packages/ui/src/components/Table/__tests__/index.test.tsx
@@ -423,14 +423,9 @@ describe('Table', () => {
fireEvent.keyDown(document, { key: 'Shift', code: 'ShiftLeft' })
- // Test hovering
- fireEvent.mouseOver(firstRowCheckbox, { shiftKey: true })
- fireEvent.mouseOver(secondRowCheckbox, { shiftKey: true })
- fireEvent.mouseOver(thirdRowCheckbox, { shiftKey: true })
-
fireEvent.keyUp(document, { key: 'Shift', code: 'ShiftLeft' })
- fireEvent.click(thirdRowCheckbox)
+ fireEvent.click(thirdRowCheckbox, { shiftKey: true })
expect(firstRowCheckbox).toBeChecked()
expect(secondRowCheckbox).toBeChecked()
|