Skip to content

Commit

Permalink
fix: control component disabling segmenter
Browse files Browse the repository at this point in the history
  • Loading branch information
Hufe921 committed Apr 16, 2024
1 parent 2985d6b commit 868a791
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/editor/core/event/handlers/click.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ZERO } from '../../../dataset/constant/Common'
import { TEXTLIKE_ELEMENT_TYPE } from '../../../dataset/constant/Element'
import { NUMBER_LIKE_REG } from '../../../dataset/constant/Regular'
import { ControlComponent } from '../../../dataset/enum/Control'
import { ElementType } from '../../../dataset/enum/Element'
import { IRange } from '../../../interface/Range'
import { CanvasEvent } from '../CanvasEvent'

Expand All @@ -19,8 +19,8 @@ function getWordRangeBySegmenter(host: CanvasEvent): IRange | null {
paragraphInfo?.elementList
?.map(e =>
!e.type ||
(TEXTLIKE_ELEMENT_TYPE.includes(e.type) &&
e.controlComponent !== ControlComponent.CHECKBOX)
(e.type !== ElementType.CONTROL &&
TEXTLIKE_ELEMENT_TYPE.includes(e.type))
? e.value
: ZERO
)
Expand Down

0 comments on commit 868a791

Please sign in to comment.