mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-24 02:51:17 -08:00
fix issue #588
This commit is contained in:
1 parent
6a895f8de1
commit
e16d96fab4
3 files changed
+8
-1
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: fix
|
||||
---
|
||||
|
||||
Fix spam-clicking abbreviations crashing sable
|
||||
@@ -77,8 +77,9 @@ function AbbreviationTerm({ text, definition }: AbbreviationTermProps) {
|
||||
const [anchor, setAnchor] = useState<RectCords | undefined>();
|
||||
|
||||
const handleClick: MouseEventHandler<HTMLElement> = (e) => {
|
||||
if (e.currentTarget === null) return;
|
||||
e.stopPropagation();
|
||||
setAnchor((prev) => (prev ? undefined : e.currentTarget.getBoundingClientRect()));
|
||||
setAnchor((prev) => (prev ? undefined : e.currentTarget?.getBoundingClientRect()));
|
||||
};
|
||||
|
||||
// On mobile, tapping an abbreviation pins the tooltip open.
|
||||
|
||||
@@ -494,6 +494,7 @@ export function ThreadDrawer({ room, threadRootId, onClose, overlay }: ThreadDra
|
||||
|
||||
const handleUserClick: MouseEventHandler<HTMLButtonElement> = useCallback(
|
||||
(evt) => {
|
||||
if (!evt.currentTarget) return;
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
const userId = evt.currentTarget.getAttribute('data-user-id');
|
||||
|
||||
Reference in new issue
Block a user