From 541659f05248123889cc852fa75fee9dccff206d Mon Sep 17 00:00:00 2001 From: Mudit Jaiswal Date: Thu, 27 Apr 2023 15:45:48 -0700 Subject: [PATCH 1/3] convert non Nan value from string to num and modifying unit tests --- components/checkbox/index.jsx | 4 +- .../__snapshots__/storybook-stories.storyshot | 262 +++++++++--------- .../__tests__/data-table.browser-test.jsx | 4 +- 3 files changed, 136 insertions(+), 134 deletions(-) diff --git a/components/checkbox/index.jsx b/components/checkbox/index.jsx index c5a898e9a1..4406450653 100644 --- a/components/checkbox/index.jsx +++ b/components/checkbox/index.jsx @@ -332,7 +332,9 @@ class Checkbox extends React.Component { }} role={props.role} required={props.required} - tabIndex={props.tabIndex} + tabIndex={!isNaN(Number(props.tabIndex)) + ? parseInt(props.tabIndex, 10) + : props.tabIndex} type="checkbox" {...ariaProps} aria-describedby={this.getAriaDescribedBy()} diff --git a/components/data-table/__docs__/__snapshots__/storybook-stories.storyshot b/components/data-table/__docs__/__snapshots__/storybook-stories.storyshot index 560295132e..9e2a146abf 100644 --- a/components/data-table/__docs__/__snapshots__/storybook-stories.storyshot +++ b/components/data-table/__docs__/__snapshots__/storybook-stories.storyshot @@ -57,7 +57,7 @@ exports[`DOM snapshots SLDSDataTable Advanced (Fixed Layout) 1`] = ` name="SelectAll" onChange={[Function]} onFocus={[Function]} - tabIndex="-1" + tabIndex={-1} type="checkbox" />