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.
This commit is contained in:
parent
f3eae3c398
commit
8499af6945
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue