Skip to content

Commit 9e5064d

Browse files
yosipybenjitrosch
authored andcommitted
chore(Modal): added ariaHidden to Modal component Props. (#456)
1 parent 9f583d2 commit 9e5064d

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/Modal/Modal.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,21 @@ export type ModalProps = React.HTMLAttributes<HTMLDialogElement> &
1414
open?: boolean
1515
responsive?: boolean
1616
backdrop?: boolean
17+
ariaHidden?: boolean
1718
}
1819

1920
const Modal = forwardRef<HTMLDialogElement, ModalProps>(
2021
(
21-
{ children, open, responsive, backdrop, dataTheme, className, ...props },
22+
{
23+
children,
24+
open,
25+
responsive,
26+
backdrop,
27+
ariaHidden,
28+
dataTheme,
29+
className,
30+
...props
31+
},
2232
ref
2333
): JSX.Element => {
2434
const containerClasses = twMerge(
@@ -29,13 +39,14 @@ const Modal = forwardRef<HTMLDialogElement, ModalProps>(
2939
})
3040
)
3141

42+
ariaHidden = ariaHidden ?? !open
3243
const bodyClasses = twMerge('modal-box', className)
3344

3445
return (
3546
<dialog
3647
{...props}
3748
aria-label="Modal"
38-
aria-hidden={!open}
49+
aria-hidden={ariaHidden}
3950
open={open}
4051
aria-modal={open}
4152
data-theme={dataTheme}

src/Range/Range.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Range = forwardRef<HTMLInputElement, RangeProps>(
4141

4242
const calculatedDisplayTicks = displayTicks ?? (step !== undefined);
4343
const calculatedStep = step !== undefined ? Number(step) : 1; // default value per HTML standard
44-
const calculatedTicksStep = ticksStep ?? calculatedStep;
44+
const calculatedTicksStep = !!ticksStep ? ticksStep : calculatedStep;
4545
const min = props.min !== undefined ? Number(props.min) : 0; // default value per HTML standard
4646
const max = props.max !== undefined ? Number(props.max) : 100; // default value per HTML standard
4747

0 commit comments

Comments
 (0)