Editor whitespace issue

1 Answer 143 Views
Editor
ted
Top achievements
Rank 1
Iron
ted asked on 14 Jun 2022, 11:19 PM

Hi all,

 

I'm importing Kendo's Editor into a fresh react project and styling with default theme. There is a large white space area at the top of the editor content area that I cannot get rid of. Any idea what's causing this?

App created using npx create-react-app.

Editor: 5.3.0

Kendo-theme-default: 5.5.0


import '@progress/kendo-theme-default/dist/all.css';
import { Editor, EditorTools } from "@progress/kendo-react-editor";
const {
  Bold,
  Italic,
  Underline,
  AlignLeft,
  AlignRight,
  AlignCenter,
  Indent,
  Outdent,
  OrderedList,
  UnorderedList,
  Undo,
  Redo,
  Link,
  Unlink,
} = EditorTools;

const content = `<p>The KendoReact Editor allows your users to edit HTML in a familiar, user-friendly way.<br />The Editor provides the core HTML editing engine, which includes text formatting, hyperlinks, and lists. The component <strong>outputs identical HTML</strong> across all major browsers, follows accessibility standards, and provides API for content manipulation.</p><p>Features include:</p><ul><li><p>Text formatting</p></li><li><p>Bulleted and numbered lists</p></li><li><p>Hyperlinks</p></li><li><p>Cross-browser support</p></li><li><p>Identical HTML output across browsers</p></li></ul>`;

const App = () => {
  return (
    <Editor
      tools={[
        [Bold, Italic, Underline],
        [Undo, Redo],
        [Link, Unlink],
        [AlignLeft, AlignCenter, AlignRight],
        [OrderedList, UnorderedList, Indent, Outdent],
      ]}
      contentStyle={{
        height: 320,
      }}
      defaultContent={content}
    />
  );
};

export default App;

 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 15 Jun 2022, 07:50 AM

Hi tianyi,

We are aware of this issue when the Editor is used in Strict Mode and the team is working on it. I also added your report to the item:

https://github.com/telerik/kendo-react/issues/1333

 

You can hide the additional content element added to the Editor as a temporary fix for this problem:

.k-content:not(.ProseMirror) {
        display: none;
}

https://stackblitz.com/edit/react-z8jwmf-vkju3g?file=app%2Fmain.jsx


Apologies for the inconvenience this might have caused you.


Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ted
Top achievements
Rank 1
Iron
commented on 15 Jun 2022, 07:55 PM

Thanks, this solved the issue.

 

Vessy
Telerik team
commented on 16 Jun 2022, 07:01 AM

You are welcome, tiany.
Vessy
Telerik team
commented on 20 Jun 2022, 03:53 PM

The issue discussed in this thread is Fixed in the newly shipped version 5.4.0 - https://stackblitz.com/edit/react-92smzf?file=app%2Fmain.jsx

Can you test it and let us know whether it works properly at your end as well? You can see the full Changelog here:

https://www.telerik.com/kendo-react-ui-develop/components/changelogs/ui-for-react/#cca1aad7-f941-57a1-be41-be469aecbaf0

Tags
Editor
Asked by
ted
Top achievements
Rank 1
Iron
Answers by
Vessy
Telerik team
Share this question
or