Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

forceAlign uses outdated onAlign callback #85

@opatut

Description

@opatut

Look here :)

if (onAlign && result) {

It seems that the onAlign prop is cached as forceAlignPropsRef.current.onAlign, such that it can be used inside the callback passed into useBuffer, using the latest passed in props value.

However, that whole code does not use the forceAlignPropsRef.current.onAlign value, but the closured onAlign value instead. I think this is wrong, and I believe it is causing ant-design/ant-design#27018.

It is all already prepared. I think we just have to use onAlign the same way we use disabled & target in L67, destructuring it to latestOnAlign.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions