diff options
| author | bobzel <zzzman@gmail.com> | 2024-09-19 02:54:28 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-09-19 02:54:28 -0400 |
| commit | 65a1a272b15fb9c08ef75a12946d7f3751a500c7 (patch) | |
| tree | b65d47b9ff967d7907a47016f7af8b66ec796f29 /src/client/views/nodes | |
| parent | 3df19b61e8ae06940822a01801a4aa6e7716ac9a (diff) | |
added stop propagation for clicking on tags and icon tags. fixed dragging crash from doc nested in card view to card view. still needs more work for card view to honor canEmbed
Diffstat (limited to 'src/client/views/nodes')
| -rw-r--r-- | src/client/views/nodes/IconTagBox.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/views/nodes/IconTagBox.tsx b/src/client/views/nodes/IconTagBox.tsx index ea1c3591a..70992e28a 100644 --- a/src/client/views/nodes/IconTagBox.tsx +++ b/src/client/views/nodes/IconTagBox.tsx @@ -4,7 +4,7 @@ import { Tooltip } from '@mui/material'; import { computed } from 'mobx'; import { observer } from 'mobx-react'; import React from 'react'; -import { numberRange } from '../../../Utils'; +import { emptyFunction, numberRange } from '../../../Utils'; import { Doc, StrListCast } from '../../../fields/Doc'; import { StrCast } from '../../../fields/Types'; import { SnappingManager } from '../../util/SnappingManager'; @@ -15,6 +15,7 @@ import { PropertiesView } from '../PropertiesView'; import { DocumentView } from './DocumentView'; import './IconTagBox.scss'; import { TagItem } from '../TagsView'; +import { returnFalse, setupMoveUpEvents } from '../../../ClientUtils'; export interface IconTagProps { Views: DocumentView[]; @@ -93,10 +94,13 @@ export class IconTagBox extends ObservableReactComponent<IconTagProps> { <button key={i} type="button" - onClick={() => { - const state = TagItem.docHasTag(this.View.Document, iconMap(i).toString()); // this.View.Document[iconMap(i).toString()]; - this.setIconTag(iconMap(i), !state); - }}> + onPointerDown={e => + setupMoveUpEvents(this, e, returnFalse, emptyFunction, clickEv => { + const state = TagItem.docHasTag(this.View.Document, iconMap(i).toString()); // this.View.Document[iconMap(i).toString()]; + this.setIconTag(iconMap(i), !state); + clickEv.stopPropagation(); + }) + }> {this.getButtonIcon(this.View.Document, iconMap(i))} </button> </Tooltip> |
