docs: fix typo (#48819)

* chore: typo

Signed-off-by: Luna <105922175+ImLunaHey@users.noreply.github.com>

* chore: typo

Signed-off-by: Luna <105922175+ImLunaHey@users.noreply.github.com>

---------

Signed-off-by: Luna <105922175+ImLunaHey@users.noreply.github.com>
This commit is contained in:
Luna 2024-05-08 16:01:12 +09:30 committed by GitHub
parent f0189fd36f
commit 3701f0a330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -138,7 +138,7 @@ useLayoutEffect(() => {
### Resolution
Due to the above queue operation, the DOM of the portal will be triggered in the next `useLayoutEffect` under nesting. This causes the `uesLayoutEffect` timing of the animation to start in `rc-dialog` after the node behavior is added, resulting in the element not being in the document and unable to obtain the correct coordinate information.
Due to the above queue operation, the DOM of the portal will be triggered in the next `useLayoutEffect` under nesting. This causes the `useLayoutEffect` timing of the animation to start in `rc-dialog` after the node behavior is added, resulting in the element not being in the document and unable to obtain the correct coordinate information.
Since Modal is already enabled, it does not need to be executed asynchronously through `queue`, so we only need to add a judgment if it is enabled, and execute `append` directly:

View File

@ -138,7 +138,7 @@ useLayoutEffect(() => {
### 问题分析
由于上述的队列操作,使得 portal 的 DOM 在嵌套下会在下一个 `useLayoutEffect` 触发。这导致添加节点行为后于 `rc-dialog` 启动动画的 `uesLayoutEffect` 时机,导致元素不在 document 中而无法获取正确的坐标信息。
由于上述的队列操作,使得 portal 的 DOM 在嵌套下会在下一个 `useLayoutEffect` 触发。这导致添加节点行为后于 `rc-dialog` 启动动画的 `useLayoutEffect` 时机,导致元素不在 document 中而无法获取正确的坐标信息。
由于 Modal 已经是开启状态,其实不需要通过 `queue` 异步执行,所以我们只需要加一个判断如果是开启状态,直接执行 `append` 即可: