Skip to content

Commit 01b093a

Browse files
committed
fixup! fixup! Change default properties from null to undefined (#662)
1 parent d06a492 commit 01b093a

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/components/Modal/Modal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const Modal = ({
121121
onMouseDown,
122122
};
123123

124-
if (portalId === null) {
124+
if (portalId === undefined) {
125125
return preRender(
126126
children,
127127
color,

src/components/Modal/_helpers/dialogOnCancelHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const dialogOnCancelHandler = (e, closeButtonRef, onCancelHandler = undef
1717
e.preventDefault();
1818

1919
// If the close button is not disabled, close the modal.
20-
if (closeButtonRef?.current !== undefined && closeButtonRef?.current?.disabled === false) {
20+
if (closeButtonRef?.current != null && closeButtonRef?.current?.disabled === false) {
2121
closeButtonRef.current.click();
2222
}
2323

src/components/Modal/_helpers/dialogOnClickHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const dialogOnClickHandler = (
4646
}
4747

4848
// If the close button is not disabled, close the modal.
49-
if (closeButtonRef?.current !== undefined && closeButtonRef?.current?.disabled === false) {
49+
if (closeButtonRef?.current != null && closeButtonRef?.current?.disabled === false) {
5050
closeButtonRef.current.click();
5151
}
5252
};

src/components/Modal/_helpers/dialogOnCloseHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const dialogOnCloseHandler = (e, closeButtonRef, onCloseHandler = undefin
1717
e.preventDefault();
1818

1919
// If the close button is not disabled, close the modal.
20-
if (closeButtonRef?.current !== undefined && closeButtonRef?.current?.disabled === false) {
20+
if (closeButtonRef?.current != null && closeButtonRef?.current?.disabled === false) {
2121
closeButtonRef.current.click();
2222
}
2323

src/components/Modal/_helpers/dialogOnKeyDownHandler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const dialogOnKeyDownHandler = (
3535
// of close event in happy-dom library. When this is fixed, the `else` statement can be removed
3636
// as the `closeButtonRef.current.click()` will be handled by `dialogOnCancelHandler.js`.
3737
if (
38-
closeButtonRef?.current === undefined
38+
closeButtonRef?.current == null
3939
|| closeButtonRef?.current?.disabled === true
4040
|| !allowCloseOnEscapeKey
4141
) {
@@ -52,7 +52,7 @@ export const dialogOnKeyDownHandler = (
5252
// 4. The focused element is an input or select (text area is omitted as Enter key is used for new line)
5353
if (
5454
e.key === 'Enter'
55-
&& primaryButtonRef?.current !== undefined
55+
&& primaryButtonRef?.current != null
5656
&& primaryButtonRef?.current?.disabled === false
5757
&& allowPrimaryActionOnEnterKey
5858
&& ['INPUT', 'SELECT'].includes(e.target.nodeName)

src/components/Modal/_hooks/useModalFocus.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const useModalFocus = (
1616

1717
const dialogElement = dialogRef.current;
1818

19-
if (dialogElement === undefined) {
19+
if (dialogElement == null) {
2020
return () => {};
2121
}
2222

@@ -41,7 +41,7 @@ export const useModalFocus = (
4141
return () => {};
4242
}
4343

44-
if (primaryButtonRef?.current !== undefined && primaryButtonRef?.current?.disabled === false) {
44+
if (primaryButtonRef?.current != null && primaryButtonRef?.current?.disabled === false) {
4545
primaryButtonRef.current.focus();
4646
return () => {};
4747
}

0 commit comments

Comments
 (0)