From 57369ea67030bce75efc2ef7ae0f2ea6998e3044 Mon Sep 17 00:00:00 2001 From: Junior Garcia Date: Thu, 14 Sep 2023 22:12:44 -0300 Subject: [PATCH] fix(utils): filterDomProps fixed --- .changeset/wild-poets-sip.md | 5 +++++ .../utilities/react-rsc-utils/src/filter-dom-props.ts | 9 +++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .changeset/wild-poets-sip.md diff --git a/.changeset/wild-poets-sip.md b/.changeset/wild-poets-sip.md new file mode 100644 index 0000000000..e2b0008371 --- /dev/null +++ b/.changeset/wild-poets-sip.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/react-rsc-utils": patch +--- + +Fix #1620 filterDomProps labelable prop is true by default diff --git a/packages/utilities/react-rsc-utils/src/filter-dom-props.ts b/packages/utilities/react-rsc-utils/src/filter-dom-props.ts index 3174658bfa..24900279f5 100644 --- a/packages/utilities/react-rsc-utils/src/filter-dom-props.ts +++ b/packages/utilities/react-rsc-utils/src/filter-dom-props.ts @@ -36,15 +36,12 @@ const funcRe = /^(on[A-Z].*)$/; */ export function filterDOMProps( props: DOMProps & AriaLabelingProps, - opts: Options = { - labelable: true, - enabled: true, - }, + opts: Options = {}, ): DOMProps & AriaLabelingProps { - let {labelable, propNames, omitPropNames, omitEventNames} = opts; + let {labelable = true, enabled = true, propNames, omitPropNames, omitEventNames} = opts; let filteredProps = {}; - if (!opts.enabled) { + if (!enabled) { return props; } for (const prop in props) {