Description
When the Strikethrough and FontSize tools are both applied to the same text selection, the strikethrough line appears near the top of the text instead of through its vertical middle. The issue occurs because the ProseMirror mark schema in @progress/kendo-editor-common orders the del mark before the style mark, so the editor renders <del><span style="font-size: Xpx">text</span></del>. The browser's UA stylesheet positions the line-through decoration using the <del> element's own (default) font-size, not the larger font-size of the inner <span>.
Workaround
As a temporary workaround, you can inject scoped CSS into the editor's document via the onMount callback. The CSS removes text-decoration from del and re-applies line-through only on del > span (i.e., when a font-size span is present inside del). When no font-size span is present, the del:not(:has(span)) rule preserves the default behavior.
https://stackblitz.com/edit/react-yujzbin3-fpptv8t6?file=package.json,app%2Fapp.tsx
Plan
KendoReact Free
Steps To Reproduce
- Go to https://stackblitz.com/edit/react-yujzbin3-k236cjtf?file=package.json,app%2Fapp.tsx
- Type some text.
- Select the text and apply a large font size (e.g.
36px / xx-large).
- With the text still selected, click the Strikethrough button (or apply strikethrough first, then font size — both orderings reproduce the issue).
Screenshots or video
No response
Actual Behavior
The strikethrough line renders near the top of the large text, not through its middle.
Expected Behavior
The strikethrough line passes through the vertical midpoint of the text, matching the larger font size.
Browser
Chrome
Browser version
latest
OS type
MacOS
OS version
No response
Aditionl details
Reported in ticket Ticket ID: 1717122
Description
When the Strikethrough and FontSize tools are both applied to the same text selection, the strikethrough line appears near the top of the text instead of through its vertical middle. The issue occurs because the ProseMirror mark schema in
@progress/kendo-editor-commonorders thedelmark before thestylemark, so the editor renders<del><span style="font-size: Xpx">text</span></del>. The browser's UA stylesheet positions theline-throughdecoration using the<del>element's own (default) font-size, not the larger font-size of the inner<span>.Workaround
As a temporary workaround, you can inject scoped CSS into the editor's document via the
onMountcallback. The CSS removestext-decorationfromdeland re-appliesline-throughonly ondel > span(i.e., when a font-size span is present insidedel). When no font-size span is present, thedel:not(:has(span))rule preserves the default behavior.https://stackblitz.com/edit/react-yujzbin3-fpptv8t6?file=package.json,app%2Fapp.tsx
Plan
KendoReact Free
Steps To Reproduce
36px/xx-large).Screenshots or video
No response
Actual Behavior
The strikethrough line renders near the top of the large text, not through its middle.
Expected Behavior
The strikethrough line passes through the vertical midpoint of the text, matching the larger font size.
Browser
Chrome
Browser version
latest
OS type
MacOS
OS version
No response
Aditionl details
Reported in ticket Ticket ID: 1717122