Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【BUG】选区格式延续错误问题 #531

Closed
puppet-666 opened this issue Apr 30, 2024 · 0 comments
Closed

【BUG】选区格式延续错误问题 #531

puppet-666 opened this issue Apr 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@puppet-666
Copy link

version

0.9.75

Link to minimal reproduction

No response

Steps to reproduce

  • 输入一段文字,并设置为标题1
  • 换行
  • 格式还是沿用着标题1,错误的 rangeStyle 如下,level为null了但是blod沿用了上一个选区的值,导致blod为true
{
    "type": "text",
    "undo": true,
    "redo": false,
    "painter": false,
    "font": "Microsoft YaHei",
    "size": 26,
    "bold": true,
    "italic": false,
    "underline": false,
    "strikeout": false,
    "color": null,
    "highlight": null,
    "rowFlex": null,
    "rowMargin": 1,
    "dashArray": [],
    "level": null,
    "listType": null,
    "listStyle": null,
    "groupIds": null,
    "textDecoration": null,
    "extension": null
}

image
image

What is expected?

  • 换行后选区文字应该变为正文格式

What is actually happening?

文件地址:src\editor\core\range\RangeManager.ts 401行

getAnchorElement 方法中选取了上一个选取的element配置,但新元素elment会继续沿用旧配置,size和blod的配置应用应该需要额外判断level

System Info

No response

Any additional comments?

No response

@Hufe921 Hufe921 added the bug Something isn't working label Apr 30, 2024
@Hufe921 Hufe921 closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants