kopia lustrzana https://github.com/Tldraw/Tldraw
ui events: prevent sending 2nd event unnecessarily (#2921)
Noticed that we were sending two events (one for pointerDown, and one for pointerUp). The click event handler adds this same check to prevent this, so this adds it in the pointerUp event as well. ### Change Type - [x] `patch` — Bug fix ### Release Notes - Some cleanup on duplicate UI events being sent.pull/2956/head
rodzic
f3eae3c398
commit
8499af6945
|
@ -78,6 +78,8 @@ function _TldrawUiButtonPicker<T extends string>(props: TLUiButtonPickerProps<T>
|
|||
|
||||
const handleButtonPointerUp = (e: React.PointerEvent<HTMLButtonElement>) => {
|
||||
const { id } = e.currentTarget.dataset
|
||||
if (value.type === 'shared' && value.value === id) return
|
||||
|
||||
onValueChange(style, id as T, false)
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue