Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
929799b
fix: 为兼容 cpp 版本做的暂时性的牺牲改动 (#3325)
xiaoyatong Aug 7, 2025
7ee836a
Merge branch 'feat_v3.x' into feat_v3.x_cpp
xiaoyatong Aug 15, 2025
94c5073
chore: 升级版本号
xiaoyatong Aug 20, 2025
5dfd20f
feat(popup): 增加上下滑动修改高度
xiaoyatong Aug 20, 2025
bd12ee6
feat: 合并popup功能
xiaoyatong Aug 21, 2025
e47d0d4
feat(popup): 添加自定义顶部
xiaoyatong Aug 21, 2025
e7a4b1f
fix(input): taro 下只读可以点击
xiaoyatong Aug 21, 2025
75057e6
feat(popup): 增加一些新属性,顺便解决了下input的只读无法点击、焦点等问题 (#3342)
xiaoyatong Aug 21, 2025
7da9642
chore: 升级版本号
xiaoyatong Aug 29, 2025
08e97b5
feat: 新样式变量值更新,修订dialog暗黑问题
xiaoyatong Sep 3, 2025
3da0ec6
chore: 修改版本号
xiaoyatong Sep 20, 2025
e90b2b2
feat(popup): 增加top属性,支持自定义节点,,且不popup高度
xiaoyatong Sep 20, 2025
3cbfe75
chore: 修改版本号
xiaoyatong Sep 20, 2025
88462db
feat: 合并3.x 分支
xiaoyatong Sep 29, 2025
8ce8c51
Feat v3 cpp td (#3364)
xiaoyatong Sep 29, 2025
68c851b
feat(dialog): 升级样式规范
xiaoyatong Oct 2, 2025
32b4cea
feat(dialog): 升级样式规范
xiaoyatong Oct 2, 2025
4e6df5d
feat: 修订button在安卓下的问题
xiaoyatong Oct 3, 2025
cf0553a
fix(noticebar): 获取rect异常时不处理
xiaoyatong Oct 4, 2025
1509b39
feat(noticebar): 增加自定义children时的样式,重构部分代码
xiaoyatong Oct 5, 2025
710afd9
feat(input): 去掉lineheight
xiaoyatong Oct 5, 2025
2be0323
feat(checkbox): 增加选中态自定义类名
xiaoyatong Oct 5, 2025
2379441
fix: dialog规范及toast ios和安卓适配问题修订
xiaoyatong Oct 9, 2025
e7f84cc
fix(dialog): 适配ios和安卓,动效暂时屏蔽
xiaoyatong Oct 10, 2025
7054cee
fix(noticebar): 增加ref id
xiaoyatong Oct 13, 2025
93c518f
feat(dialog): demo
xiaoyatong Oct 13, 2025
1b997a4
fix: 去掉不支持的样式
xiaoyatong Oct 13, 2025
23dba7a
fix: 回跨不兼容样式处理
xiaoyatong Oct 14, 2025
0354507
fix: 回跨不兼容样式处理,不能暴露~~
xiaoyatong Oct 14, 2025
dadca5b
fix: setTimeout 改调 Taro.nextTick 调用,保证rect能够获取成功 (#3369)
aniwei Oct 15, 2025
77ae33b
feat: 修订 toast 鸿蒙下折行问题,noticebar 获取宽度问题
xiaoyatong Oct 15, 2025
01a2bca
fix: ios/安卓不支持属性增加判断
xiaoyatong Oct 21, 2025
3d88959
feat: dialog 底部按钮增加角标展示
xiaoyatong Oct 24, 2025
075b551
fix: hack 动效 tabs 安卓
xiaoyatong Oct 24, 2025
2e7cbd2
feat: 添加部分组件无障碍功能支持
yangyanAurora Nov 10, 2025
61863f5
Update checkbox.tsx
yangyanAurora Nov 10, 2025
7d0f814
Update src/packages/countdown/demos/h5/demo10.tsx
yangyanAurora Nov 10, 2025
0cdc8f4
Update demo.taro.tsx
yangyanAurora Nov 10, 2025
30d9fdf
Update demo.tsx
yangyanAurora Nov 10, 2025
76c0e2f
Update src/packages/noticebar/demos/h5/demo12.tsx
yangyanAurora Nov 10, 2025
3ce6c79
fix: update
yangyanAurora Nov 10, 2025
9d0911f
Update src/packages/price/price.taro.tsx
yangyanAurora Nov 10, 2025
7507379
Update price.taro.tsx
yangyanAurora Nov 11, 2025
858715d
Update price.tsx
yangyanAurora Nov 11, 2025
c8b6c1f
Update src/packages/radio/radio.taro.tsx
yangyanAurora Nov 11, 2025
cd4dd52
Update src/packages/radio/radio.tsx
yangyanAurora Nov 11, 2025
72a0e64
fix: update
yangyanAurora Nov 11, 2025
9954f35
fix: update
yangyanAurora Nov 12, 2025
e4f1ed9
Merge remote-tracking branch 'upstream/feat_v3.x_cpp' into feat_v3.x
yangyanAurora Nov 13, 2025
66092f4
feat: 添加组件无障碍支持
yangyanAurora Nov 13, 2025
57ad0d6
fix: update
yangyanAurora Nov 14, 2025
884d3bc
Feat v3.x aria (#3387)
yangyanAurora Nov 14, 2025
b66439e
feat: 无障碍类型检测屏蔽
xiaoyatong Nov 14, 2025
e9f4a44
fix: 无需处理容器维度,系统会无法读取内部的文字
xiaoyatong Nov 17, 2025
01456f9
fix: merge branch 'upstream feat_v3.x_cpp ' to 'feat_v3.x'
yangyanAurora Nov 17, 2025
d32fd32
fix: update merge issue
yangyanAurora Nov 21, 2025
3af56f1
fix: update about ARIA including component:
yangyanAurora Nov 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/packages/button/button.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const Button = React.forwardRef<HTMLButtonElement, Partial<ButtonProps>>(
className={buttonClassNames}
style={{ ...getStyle, ...style }}
onClick={(e) => handleClick(e as any)}
ariaLabel="button"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

硬编码的 ariaLabel 值缺乏实用性。

ariaLabel 硬编码为 "button" 不会为屏幕阅读器用户提供有意义的信息。应该:

  1. 通过 props 使其可配置
  2. 描述按钮的具体用途而非仅说明它是按钮
  3. 设为可选属性,因为按钮内容通常已提供足够的上下文

建议应用以下修改:

ButtonProps 接口中添加可选的 ariaLabel 属性:

 export interface ButtonProps
   extends BasicComponent,
     OmitMiniProgramButtonProps {
   color: string
   shape: ButtonShape
   type: ButtonType
   size: ButtonSize
   fill: ButtonFill
   block: boolean
   loading: boolean
   disabled: boolean
   icon: React.ReactNode
   rightIcon: React.ReactNode
   nativeType: 'submit' | 'reset' // | 'button'
   onClick: (e: MouseEvent<HTMLButtonElement>) => void
+  ariaLabel?: string
 }

然后在组件中使用:

 const {
   color,
   shape,
   fill,
   loading,
   disabled,
   type,
   size,
   block,
   icon,
   rightIcon,
   children,
   className,
   style,
   formType,
   nativeType,
   onClick,
+  ariaLabel,
   ...rest
 } = { ...defaultProps, ...props }

在渲染时有条件地应用:

 <TaroButton
   {...rest}
   ref={ref}
   formType={formType || nativeType}
   className={buttonClassNames}
   style={{ ...getStyle, ...style }}
   onClick={(e) => handleClick(e as any)}
-  ariaLabel="button"
+  {...(ariaLabel && { ariaLabel })}
 >

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/packages/button/button.taro.tsx around line 162, the ariaLabel is
hardcoded to "button"; update ButtonProps to include an optional ariaLabel?:
string, accept it in the component props, and replace the hardcoded ariaLabel
with the passed-in prop so the rendered element conditionally sets the
aria-label attribute only when ariaLabel is provided (or uses a meaningful
fallback like the button text if you choose), ensuring the value describes the
button's purpose rather than the generic word "button".

>
<View className="nut-button-wrap">
{loading && <Loading className="nut-icon-loading" />}
Expand Down
2 changes: 2 additions & 0 deletions src/packages/checkbox/checkbox.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ export const Checkbox: FC<
)}
{...rest}
onClick={handleClick}
ariaRole="checkbox"
ariaChecked={innerChecked && !innerIndeterminate}
>
{renderCheckboxItem()}
</View>
Expand Down
3 changes: 3 additions & 0 deletions src/packages/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ export const Checkbox: FunctionComponent<
)}
{...rest}
onClick={handleClick}
role="checkbox"
tabIndex={0}
aria-checked={innerChecked && !innerIndeterminate}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

aria-checked 对不确定状态的处理不正确。

当前的 aria-checked={innerChecked && !innerIndeterminate} 实现存在严重问题:

  1. 不确定状态处理错误:当复选框处于不确定状态(indeterminate=true)时,aria-checked 应该是 "mixed",而不是 false
  2. 类型不正确aria-checked 应该接受 "true" | "false" | "mixed",而非布尔运算结果
  3. tabIndex 未考虑禁用状态:禁用的复选框不应该可聚焦

应用以下修改:

 <div
   className={classNames(
     classPrefix,
     {
       [`${classPrefix}-reverse`]: labelPosition === 'left',
       'nut-checkbox-list-item': ctx?.list,
     },
     className
   )}
   {...rest}
   onClick={handleClick}
   role="checkbox"
-  tabIndex={0}
-  aria-checked={innerChecked && !innerIndeterminate}
+  tabIndex={innerDisabled ? -1 : 0}
+  aria-checked={innerIndeterminate ? 'mixed' : innerChecked}
 >
   {renderCheckboxItem()}
 </div>

此外,建议添加键盘事件处理器以支持空格键切换复选框:

+const handleKeyDown = (e: React.KeyboardEvent) => {
+  if (e.key === ' ' || e.key === 'Enter') {
+    e.preventDefault()
+    handleClick()
+  }
+}
+
 <div
   className={classNames(
     classPrefix,
     {
       [`${classPrefix}-reverse`]: labelPosition === 'left',
       'nut-checkbox-list-item': ctx?.list,
     },
     className
   )}
   {...rest}
   onClick={handleClick}
+  onKeyDown={handleKeyDown}
   role="checkbox"
   tabIndex={innerDisabled ? -1 : 0}
   aria-checked={innerIndeterminate ? 'mixed' : innerChecked}
 >

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/packages/checkbox/checkbox.tsx around lines 211-213, aria-checked and
tabIndex are incorrect: change aria-checked to return the string union "true" |
"false" | "mixed" (e.g. innerIndeterminate ? "mixed" : innerChecked ? "true" :
"false") instead of a boolean expression, make tabIndex non-focusable when
disabled (e.g. tabIndex={disabled ? -1 : 0}), and add a onKeyDown handler that
listens for the Space key, prevents default, and toggles the checkbox
(respecting disabled state) so keyboard users can toggle via space.

>
{renderCheckboxItem()}
</div>
Expand Down
16 changes: 16 additions & 0 deletions src/packages/countdown/countdown.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const InternalCountDown: ForwardRefRenderFunction<
onRestart,
onUpdate,
children,
ariaRoledescription,
...rest
} = { ...defaultProps, ...props }
const classPrefix = 'nut-countdown'
Expand All @@ -64,6 +65,10 @@ const InternalCountDown: ForwardRefRenderFunction<
diffTime: 0, // 设置了 startTime 时,与 date.now() 的差异
})

const [role, setRole] = useState('')
// ARIA alert提示内容
const [alertContent, setAlertContent] = useState('')

// 时间戳转换 或 获取当前时间的时间戳
const getTimeStamp = (timeStr?: string | number) => {
if (!timeStr) return Date.now()
Expand Down Expand Up @@ -102,6 +107,12 @@ const InternalCountDown: ForwardRefRenderFunction<
stateRef.current.counting = false
pause()
onEnd && onEnd()
setRole('alert')
setAlertContent('时间到')
setTimeout(() => {
setRole('')
setAlertContent('')
}, 3000)
Comment on lines 112 to 117
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

修复潜在的内存泄漏

setTimeout 设置的定时器在组件卸载时未被清除,可能导致内存泄漏。当倒计时结束后,如果组件在 3 秒内被卸载,定时器仍会尝试调用 setRolesetAlertContent,可能导致 React 警告或内存泄漏。

基于学习经验(Based on learnings)

建议将定时器 ID 存储在 ref 中并在组件卸载时清除:

+  const alertTimerRef = useRef<number>()
+
   // ... 在 tick 函数中
         if (!remainTime) {
           stateRef.current.counting = false
           pause()
           onEnd && onEnd()
           setRole('alert')
           setAlertContent('时间到')
-          setTimeout(() => {
+          alertTimerRef.current = window.setTimeout(() => {
             setRole('')
             setAlertContent('')
           }, 3000)
         }

并在 componentWillUnmount 中清除:

   const componentWillUnmount = () => {
     destroy && cancelAnimationFrame(stateRef.current.timer)
+    if (alertTimerRef.current) {
+      clearTimeout(alertTimerRef.current)
+    }
   }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/packages/countdown/countdown.taro.tsx around lines 110 to 115, the
setTimeout used to clear role/alertContent is not tracked or cleared on unmount
which can cause state updates after unmount; store the timeout ID in a ref (e.g.
timeoutRef), assign the ID when calling setTimeout, clear any existing timeout
before creating a new one, and clear the timeout in useEffect
cleanup/componentWillUnmount to prevent the callback running after the component
is unmounted.

}

if (remainTime > 0) {
Expand Down Expand Up @@ -327,9 +338,14 @@ const InternalCountDown: ForwardRefRenderFunction<
<View
className={`${classPrefix} ${className}`}
style={{ ...style }}
ariaLabel="倒计时"
ariaRoledescription={ariaRoledescription}
{...rest}
>
{renderTaroTime()}
<View role={role} style={{ display: 'none' }}>
{alertContent}
</View>
</View>
)}
</>
Expand Down
15 changes: 14 additions & 1 deletion src/packages/countdown/countdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const InternalCountDown: ForwardRefRenderFunction<
onRestart,
onUpdate,
children,
ariaRoledescription,
...rest
} = { ...defaultProps, ...props }
const classPrefix = 'nut-countdown'
Expand All @@ -61,6 +62,10 @@ const InternalCountDown: ForwardRefRenderFunction<
diffTime: 0, // 设置了 startTime 时,与 date.now() 的差异
})

const [role, setRole] = useState('')
// ARIA alert提示内容
const [alertContent, setAlertContent] = useState('')

// 时间戳转换 或 获取当前时间的时间戳
const getTimeStamp = (timeStr?: string | number) => {
if (!timeStr) return Date.now()
Expand Down Expand Up @@ -97,6 +102,12 @@ const InternalCountDown: ForwardRefRenderFunction<
stateRef.current.counting = false
pause()
onEnd && onEnd()
setRole('alert')
setAlertContent('时间到')
setTimeout(() => {
setRole('')
setAlertContent('')
}, 3000)
}

if (remainTime > 0) {
Expand Down Expand Up @@ -282,9 +293,11 @@ const InternalCountDown: ForwardRefRenderFunction<
<div
className={`${classPrefix} ${className}`}
style={{ ...style }}
aria-label="倒计时"
aria-roledescription={ariaRoledescription}
{...rest}
dangerouslySetInnerHTML={{
__html: `${renderTime}`,
__html: `${renderTime}<span style="display:none" role=${role}>${alertContent}</span>`,
}}
/>
)}
Expand Down
6 changes: 6 additions & 0 deletions src/packages/countdown/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Demo6 from './demos/taro/demo6'
import Demo7 from './demos/taro/demo7'
import Demo8 from './demos/taro/demo8'
import Demo9 from './demos/taro/demo9'
import Demo10 from './demos/taro/demo10'

const CountDownDemo = () => {
const [translated] = useTranslate({
Expand All @@ -25,6 +26,7 @@ const CountDownDemo = () => {
controlTime: '控制开始和暂停的倒计时',
customStyle: '自定义展示样式',
handleControl: '手动控制',
ariaBasic: 'ARIA基础用法',
},
'zh-TW': {
basic: '基础用法',
Expand All @@ -36,6 +38,7 @@ const CountDownDemo = () => {
controlTime: '控製開始和暫停的倒計時',
customStyle: '自定義展示樣式',
handleControl: '手動控製',
ariaBasic: 'ARIA基础用法',
},
'en-US': {
basic: 'Basic Usage',
Expand All @@ -47,6 +50,7 @@ const CountDownDemo = () => {
controlTime: 'Manual Control',
customStyle: 'Custom Style',
handleControl: 'Handle Control',
ariaBasic: 'ARIA Basic Usage',
},
})

Expand Down Expand Up @@ -76,6 +80,8 @@ const CountDownDemo = () => {
<Demo8 />
<View className="h2">{translated.handleControl}</View>
<Demo9 />
<View className="h2">{translated.ariaBasic}</View>
<Demo10 />
</ScrollView>
</>
)
Expand Down
6 changes: 6 additions & 0 deletions src/packages/countdown/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Demo6 from './demos/h5/demo6'
import Demo7 from './demos/h5/demo7'
import Demo8 from './demos/h5/demo8'
import Demo9 from './demos/h5/demo9'
import Demo10 from './demos/h5/demo10'

const CountDownDemo = () => {
const [translated] = useTranslate({
Expand All @@ -22,6 +23,7 @@ const CountDownDemo = () => {
controlTime: '控制开始和暂停的倒计时',
customStyle: '自定义展示样式',
handleControl: '手动控制',
ariaBasic: 'ARIA基础用法',
},
'zh-TW': {
basic: '基础用法',
Expand All @@ -33,6 +35,7 @@ const CountDownDemo = () => {
controlTime: '控製開始和暫停的倒計時',
customStyle: '自定義展示樣式',
handleControl: '手動控製',
ariaBasic: 'ARIA基础用法',
},
'en-US': {
basic: 'Basic Usage',
Expand All @@ -44,6 +47,7 @@ const CountDownDemo = () => {
controlTime: 'Manual Control',
customStyle: 'Custom Style',
handleControl: 'Handle Control',
ariaBasic: 'ARIA Basic Usage',
},
})

Expand All @@ -68,6 +72,8 @@ const CountDownDemo = () => {
<Demo8 />
<h2>{translated.handleControl}</h2>
<Demo9 />
<h2>{translated.ariaBasic}</h2>
<Demo10 />
</div>
</>
)
Expand Down
39 changes: 39 additions & 0 deletions src/packages/countdown/demos/h5/demo10.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { useRef } from 'react'
import { Cell, CountDown } from '@nutui/nutui-react'

const Demo1 = () => {
const stateRef = useRef({
endTime: Date.now() + 10 * 1000,
})
const onEnd = () => {
console.log('countdown: ended.')
}
return (
<>
<Cell>
<CountDown
endTime={stateRef.current.endTime}
type="primary"
onEnd={onEnd}
ariaRoledescription="双十一活动"
/>
</Cell>
<Cell>
<CountDown
endTime={stateRef.current.endTime}
onEnd={onEnd}
ariaRoledescription="双十一活动"
/>
</Cell>
<Cell>
<CountDown
endTime={stateRef.current.endTime}
type="text"
onEnd={onEnd}
ariaRoledescription="双十一活动"
/>
</Cell>
</>
)
}
export default Demo1
39 changes: 39 additions & 0 deletions src/packages/countdown/demos/taro/demo10.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { useRef } from 'react'
import { Cell, CountDown } from '@nutui/nutui-react-taro'

const Demo1 = () => {
const stateRef = useRef({
endTime: Date.now() + 60 * 1000,
})
const onEnd = () => {
console.log('countdown: ended.')
}
return (
<>
<Cell>
<CountDown
endTime={stateRef.current.endTime}
type="primary"
onEnd={onEnd}
ariaRoledescription="双十一活动"
/>
</Cell>
<Cell>
<CountDown
endTime={stateRef.current.endTime}
onEnd={onEnd}
ariaRoledescription="双十一活动"
/>
</Cell>
<Cell>
<CountDown
endTime={stateRef.current.endTime}
type="text"
onEnd={onEnd}
ariaRoledescription="双十一活动"
/>
</Cell>
</>
)
}
export default Demo1
4 changes: 4 additions & 0 deletions src/packages/dialog/content.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export const Content: FunctionComponent<
style,
className,
onClick,
ariaRole,
ariaModal,
} = { ...defaultContentProps, ...props }

const classPrefix = 'nut-dialog'
Expand Down Expand Up @@ -59,6 +61,8 @@ export const Content: FunctionComponent<
className={classNames(`${classPrefix}-outer`, className)}
style={style}
onClick={(e: ITouchEvent) => handleClick(e)}
ariaRole={ariaRole}
ariaModal={visible}
>
{close}
{header}
Expand Down
3 changes: 3 additions & 0 deletions src/packages/dialog/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Content: FunctionComponent<
style,
className,
onClick,
role,
} = { ...defaultContentProps, ...props }

const classPrefix = 'nut-dialog'
Expand Down Expand Up @@ -58,6 +59,8 @@ export const Content: FunctionComponent<
className={classNames(`${classPrefix}-outer`, className)}
style={style}
onClick={handleClick}
role={role}
aria-modal={visible}
>
{close}
{header}
Expand Down
5 changes: 5 additions & 0 deletions src/packages/dialog/dialog.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const defaultProps = {
onClose: () => {},
onConfirm: () => {},
onOverlayClick: () => true,
role: 'dialog',
} as TaroDialogProps

export const BaseDialog: FunctionComponent<Partial<TaroDialogProps>> & {
Expand Down Expand Up @@ -81,6 +82,7 @@ export const BaseDialog: FunctionComponent<Partial<TaroDialogProps>> & {
onCancel,
onConfirm,
onOverlayClick,
role,
},
setParams,
} = useParams(mergeProps(defaultProps, props))
Expand Down Expand Up @@ -229,6 +231,7 @@ export const BaseDialog: FunctionComponent<Partial<TaroDialogProps>> & {
footer={renderFooter()}
footerDirection={footerDirection}
visible={visible}
ariaRole={role}
>
{content || children}
</Content>
Expand All @@ -241,6 +244,7 @@ export const BaseDialog: FunctionComponent<Partial<TaroDialogProps>> & {
style={{ display: visible ? 'block' : 'none' }}
ref={refObject}
catchMove={lockScroll}
ariaModal={visible}
>
{overlay && (
<Overlay
Expand All @@ -251,6 +255,7 @@ export const BaseDialog: FunctionComponent<Partial<TaroDialogProps>> & {
closeOnOverlayClick={closeOnOverlayClick}
lockScroll={lockScroll}
onClick={onHandleClickOverlay}
ariaRoledescription="背景蒙层"
/>
)}
{renderContent()}
Expand Down
3 changes: 2 additions & 1 deletion src/packages/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ const BaseDialog: ForwardRefRenderFunction<unknown, Partial<WebDialogProps>> = (
footer={renderFooter()}
footerDirection={footerDirection}
visible={visible}
role="dialog"
>
{content || children}
</Content>
Expand All @@ -226,7 +227,7 @@ const BaseDialog: ForwardRefRenderFunction<unknown, Partial<WebDialogProps>> = (
}

return (
<div style={{ display: visible ? 'block' : 'none' }}>
<div style={{ display: visible ? 'block' : 'none' }} aria-modal={visible}>
{overlay && (
<Overlay
zIndex={zIndex}
Expand Down
Loading