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
Mime Čuvalo 2024-02-26 10:08:27 +00:00 zatwierdzone przez GitHub
rodzic f3eae3c398
commit 8499af6945
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -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)
}