File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import ArrowToMouse from "../ArrowToMouse"
1212import { useTimeout , useWindowSize } from "react-use"
1313import SequenceItem from "../SequenceItem"
1414import classNames from "classnames"
15+ import stringToSequence from "../../string-to-sequence"
1516import useEventCallback from "use-event-callback"
1617
1718const Container = styled ( "div" ) ( ( { relationshipsOn } ) => ( {
@@ -82,7 +83,15 @@ export default function Document({
8283 highlightedItems . push ( i )
8384 }
8485
85- const onRemoveLabel = useEventCallback ( sequenceItemIndex => { } )
86+ const onRemoveLabel = useEventCallback ( sequenceItemIndex => {
87+ onSequenceChange (
88+ sequence
89+ . flatMap ( ( s , i ) =>
90+ i !== sequenceItemIndex ? s : stringToSequence ( s . text )
91+ )
92+ . filter ( s => s . text . length > 0 )
93+ )
94+ } )
8695
8796 return (
8897 < Container
Original file line number Diff line number Diff line change @@ -141,11 +141,6 @@ export const SequenceItem = ({
141141 onClick = { e => {
142142 e . stopPropagation ( )
143143 onRemoveLabel ( sequenceItemIndex )
144- // onSequenceChange(
145- // sequence
146- // .flatMap(s => (s !== seq ? s : stringToSequence(s.text)))
147- // .filter(s => s.text.length > 0)
148- // )
149144 } }
150145 >
151146 < span > ✖</ span >
You can’t perform that action at this time.
0 commit comments