Skip to content

Commit d35903d

Browse files
authored
fix: explicitly set the list style type on the UnorderedList and OrderedList components (#2966)
1 parent 9bfdae5 commit d35903d

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@twilio-paste/list': patch
3+
'@twilio-paste/core': patch
4+
---
5+
6+
[List] explicitly set the list style type on UnorderedList and OrderedList components.

packages/paste-core/components/list/src/List.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {isMarginTokenProp} from '@twilio-paste/style-props';
66
import type {AsTags, BaseListProps} from './types';
77

88
const List = React.forwardRef<HTMLOListElement | HTMLUListElement, BaseListProps>(
9-
({as, children, element = 'LIST', ...props}, ref) => {
9+
({as, children, element = 'LIST', listStyleType = 'disc', ...props}, ref) => {
1010
return (
1111
<Text
1212
{...props}
@@ -17,6 +17,7 @@ const List = React.forwardRef<HTMLOListElement | HTMLUListElement, BaseListProps
1717
fontWeight="fontWeightNormal"
1818
lineHeight="lineHeight40"
1919
marginLeft="space70"
20+
listStyleType={listStyleType}
2021
ref={ref}
2122
>
2223
{children}

packages/paste-core/components/list/src/OrderedList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const OrderedList = React.forwardRef<HTMLOListElement, OrderedListProps>(
1515
element={element}
1616
marginTop={marginTop}
1717
marginBottom={marginBottom}
18+
listStyleType="decimal"
1819
ref={ref}
1920
>
2021
{children}

packages/paste-core/components/list/src/UnorderedList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const UnorderedList = React.forwardRef<HTMLUListElement, UnorderedListProps>(
1616
marginTop={marginTop}
1717
marginBottom={marginBottom}
1818
ref={ref}
19+
listStyleType="disc"
1920
>
2021
{children}
2122
</List>

packages/paste-core/components/list/src/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import type {Space} from '@twilio-paste/style-props';
33

44
export type AsTags = 'ol' | 'ul';
55

6-
export interface BaseListProps extends React.OlHTMLAttributes<HTMLElement>, Pick<TextProps, 'element'> {
6+
export interface BaseListProps
7+
extends React.OlHTMLAttributes<HTMLElement>,
8+
Pick<TextProps, 'element' | 'listStyleType'> {
79
className?: never;
810
style?: never;
911
as: AsTags;

0 commit comments

Comments
 (0)