Skip to content

Redundant code in inline-combobox.tsx #4778

@12joan

Description

@12joan

Description

In this code in inline-combobox.tsx, the point ref has no effect since its immutable current property is immediately stored on a plain React ref.

React.useEffect(() => {
const path = editor.api.findPath(element);
if (!path) return;
const point = editor.api.before(path);
if (!point) return;
const pointRef = editor.api.pointRef(point);
insertPoint.current = pointRef.current;
return () => {
pointRef.unref();
};
}, [editor, element]);

This was added from #4031 (comment). I'm not sure whether this mistake will result in any bugs (possibly an incorrect insertion point in a collaborative editor?), but I thought it best to flag it just in case.

Reproduction URL

No response

Reproduction steps

N/A

Plate version

52.0.8

Slate React version

0.117.4

Screenshots

Logs

Browsers

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions