fix: copy row properties on input #415
This commit is contained in:
@@ -1071,7 +1071,7 @@ export class Draw {
|
||||
ascent: 0,
|
||||
elementList: [],
|
||||
startIndex: 0,
|
||||
rowFlex: elementList?.[1]?.rowFlex
|
||||
rowFlex: elementList?.[0]?.rowFlex || elementList?.[1]?.rowFlex
|
||||
})
|
||||
}
|
||||
// 列表位置
|
||||
@@ -1449,7 +1449,7 @@ export class Draw {
|
||||
startIndex: i,
|
||||
elementList: [rowElement],
|
||||
ascent,
|
||||
rowFlex: elementList[i + 1]?.rowFlex,
|
||||
rowFlex: elementList[i]?.rowFlex || elementList[i + 1]?.rowFlex,
|
||||
isPageBreak: element.type === ElementType.PAGE_BREAK
|
||||
}
|
||||
// 控件缩进
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { ZERO } from '../../../../dataset/constant/Common'
|
||||
import { EDITOR_ELEMENT_STYLE_ATTR } from '../../../../dataset/constant/Element'
|
||||
import {
|
||||
EDITOR_ELEMENT_STYLE_ATTR,
|
||||
EDITOR_ROW_ATTR
|
||||
} from '../../../../dataset/constant/Element'
|
||||
import { IElement } from '../../../../interface/Element'
|
||||
import {
|
||||
formatElementContext,
|
||||
@@ -47,7 +50,8 @@ export function enter(evt: KeyboardEvent, host: CanvasEvent) {
|
||||
// 复制样式属性
|
||||
const copyElement = getAnchorElement(elementList, endIndex)
|
||||
if (copyElement) {
|
||||
EDITOR_ELEMENT_STYLE_ATTR.forEach(attr => {
|
||||
const copyAttr = [...EDITOR_ELEMENT_STYLE_ATTR, ...EDITOR_ROW_ATTR]
|
||||
copyAttr.forEach(attr => {
|
||||
const value = copyElement[attr] as never
|
||||
if (value !== undefined) {
|
||||
enterText[attr] = value
|
||||
|
||||
@@ -13,6 +13,8 @@ export const EDITOR_ELEMENT_STYLE_ATTR: Array<keyof IElement> = [
|
||||
'strikeout'
|
||||
]
|
||||
|
||||
export const EDITOR_ROW_ATTR: Array<keyof IElement> = ['rowFlex', 'rowMargin']
|
||||
|
||||
export const EDITOR_ELEMENT_COPY_ATTR: Array<keyof IElement> = [
|
||||
'type',
|
||||
'font',
|
||||
@@ -28,7 +30,9 @@ export const EDITOR_ELEMENT_COPY_ATTR: Array<keyof IElement> = [
|
||||
'hyperlinkId',
|
||||
'dateId',
|
||||
'dateFormat',
|
||||
'groupIds'
|
||||
'groupIds',
|
||||
'rowFlex',
|
||||
'rowMargin'
|
||||
]
|
||||
|
||||
export const EDITOR_ELEMENT_ZIP_ATTR: Array<keyof IElement> = [
|
||||
|
||||
Reference in New Issue
Block a user