- Notifications
You must be signed in to change notification settings - Fork175
Add preview ref api for Node#133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
019947c
toa342e61
CompareThis does look much better! I'm not as familiar with the drag and drop api. How would you style the drag preview? |
node:NodeApi<T>; | ||
tree:TreeApi<T>; | ||
dragHandle?:(el:HTMLDivElement|null)=>void; | ||
previewHandle?:(el:HTMLDivElement|null)=>void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
How does this previewHandle get used?
spellforceMay 12, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
it will be used in nodeRender, if user need. They can custom preview div ref.
such as :
<div ref={previewHandle}><dragImg ref={dragHandle} />im a test</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh ok, I see.
Issues
One of the phenomena of Chrome browsers on Mac is that outside the DND range, the Drag or Drop event will be delayed by 250ms, because to play the animation, react-DND uses
preview(getEmptyImage());
. Going to overlay causes a problem: it looks stutteringSo the default preview was removed, the default preview was changed to react-dnd's preview, and the preview interface was exposed
This feature only affects the default effect