Skip to content

Commit

Permalink
fix(ActionListItem): checkbox spacing (#1734)
Browse files Browse the repository at this point in the history
* fix: checkbox spacing in actionlistitem

* Create tricky-mice-tie.md

* fix: snapshots
  • Loading branch information
saurabhdaware authored Oct 20, 2023
1 parent a495760 commit 08c161b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-mice-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@razorpay/blade": patch
---

fix(ActionListItem): checkbox spacing
11 changes: 4 additions & 7 deletions packages/blade/src/components/ActionList/ActionListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,6 @@ const ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {
componentId: componentIds.ActionListItemText,
});

const ActionListCheckboxWrapper = styled(BaseBox)<{ hasDescription: boolean }>((_props) => ({
pointerEvents: 'none',
}));

type ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;

const makeActionListItemClickable = (
Expand Down Expand Up @@ -287,8 +283,9 @@ const _ActionListItemBody = ({
<BaseBox display="flex" justifyContent="center" alignItems="center">
{selectionType === 'multiple' ? (
// Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us
<ActionListCheckboxWrapper
hasDescription={Boolean(description)}
<BaseBox
pointerEvents="none"
paddingRight="spacing.2"
{...makeAccessible({
hidden: true,
})}
Expand All @@ -300,7 +297,7 @@ const _ActionListItemBody = ({
*/}
{null}
</Checkbox>
</ActionListCheckboxWrapper>
</BaseBox>
) : (
leading
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -931,12 +931,12 @@ exports[`<Dropdown /> with <AutoComplete /> should render AutoComplete 1`] = `
<View
accessibilityElementsHidden={true}
data-blade-component="base-box"
hasDescription={false}
importantForAccessibility="no-hide-descendants"
pointerEvents="none"
style={
[
{},
{
"paddingRight": 4,
"pointerEvents": "none",
},
]
Expand Down Expand Up @@ -1219,12 +1219,12 @@ exports[`<Dropdown /> with <AutoComplete /> should render AutoComplete 1`] = `
<View
accessibilityElementsHidden={true}
data-blade-component="base-box"
hasDescription={false}
importantForAccessibility="no-hide-descendants"
pointerEvents="none"
style={
[
{},
{
"paddingRight": 4,
"pointerEvents": "none",
},
]
Expand Down Expand Up @@ -1507,12 +1507,12 @@ exports[`<Dropdown /> with <AutoComplete /> should render AutoComplete 1`] = `
<View
accessibilityElementsHidden={true}
data-blade-component="base-box"
hasDescription={false}
importantForAccessibility="no-hide-descendants"
pointerEvents="none"
style={
[
{},
{
"paddingRight": 4,
"pointerEvents": "none",
},
]
Expand Down

0 comments on commit 08c161b

Please sign in to comment.