From 3e61862642cc481954a78cbc69f9a7aa296f80c0 Mon Sep 17 00:00:00 2001 From: Alyson Mota <121827462+alysonmota@users.noreply.github.com> Date: Sun, 10 May 2026 06:21:44 -0300 Subject: [PATCH] fix(password-input): prevent fallback property from leaking to DOM as invalid HTML attribute (#3880) fix(password-input): prevent fallback prop from leaking to DOM as invalid HTML attribute Co-authored-by: alysonmota --- .../password-input/password-input-indicator.tsx | 5 +++-- .../password-input/password-input-indicator.tsx | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/react/src/components/password-input/password-input-indicator.tsx b/packages/react/src/components/password-input/password-input-indicator.tsx index 9a37bc5fd5..829cdc7e64 100644 --- a/packages/react/src/components/password-input/password-input-indicator.tsx +++ b/packages/react/src/components/password-input/password-input-indicator.tsx @@ -15,11 +15,12 @@ export interface PasswordInputIndicatorProps extends HTMLProps<'span'>, Password export const PasswordInputIndicator = forwardRef((props, ref) => { const passwordInput = usePasswordInputContext() - const mergedProps = mergeProps(passwordInput.getIndicatorProps(), props) + const { fallback, children, ...rest } = props + const mergedProps = mergeProps(passwordInput.getIndicatorProps(), rest) return ( - {passwordInput.visible ? props.children : props.fallback} + {passwordInput.visible ? children : fallback} ) }) diff --git a/packages/solid/src/components/password-input/password-input-indicator.tsx b/packages/solid/src/components/password-input/password-input-indicator.tsx index b3f39911d2..6ef6ee5339 100644 --- a/packages/solid/src/components/password-input/password-input-indicator.tsx +++ b/packages/solid/src/components/password-input/password-input-indicator.tsx @@ -1,5 +1,5 @@ import { mergeProps } from '@zag-js/solid' -import { type JSX, Show } from 'solid-js' +import { type JSX, Show, splitProps } from 'solid-js' import { type HTMLProps, type PolymorphicProps, ark } from '../factory' import { usePasswordInputContext } from './use-password-input-context' @@ -13,12 +13,13 @@ export interface PasswordInputIndicatorProps extends HTMLProps<'span'>, Password export const PasswordInputIndicator = (props: PasswordInputIndicatorProps) => { const passwordInput = usePasswordInputContext() - const mergedProps = mergeProps(() => passwordInput().getIndicatorProps(), props) + const [local, rest] = splitProps(props, ['fallback', 'children']) + const mergedProps = mergeProps(() => passwordInput().getIndicatorProps(), rest) return ( - - {props.children} + + {local.children} )