fix: control component disabling segmenter
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { ZERO } from '../../../dataset/constant/Common'
|
import { ZERO } from '../../../dataset/constant/Common'
|
||||||
import { TEXTLIKE_ELEMENT_TYPE } from '../../../dataset/constant/Element'
|
import { TEXTLIKE_ELEMENT_TYPE } from '../../../dataset/constant/Element'
|
||||||
import { NUMBER_LIKE_REG } from '../../../dataset/constant/Regular'
|
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 { IRange } from '../../../interface/Range'
|
||||||
import { CanvasEvent } from '../CanvasEvent'
|
import { CanvasEvent } from '../CanvasEvent'
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ function getWordRangeBySegmenter(host: CanvasEvent): IRange | null {
|
|||||||
paragraphInfo?.elementList
|
paragraphInfo?.elementList
|
||||||
?.map(e =>
|
?.map(e =>
|
||||||
!e.type ||
|
!e.type ||
|
||||||
(TEXTLIKE_ELEMENT_TYPE.includes(e.type) &&
|
(e.type !== ElementType.CONTROL &&
|
||||||
e.controlComponent !== ControlComponent.CHECKBOX)
|
TEXTLIKE_ELEMENT_TYPE.includes(e.type))
|
||||||
? e.value
|
? e.value
|
||||||
: ZERO
|
: ZERO
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user