🐛 Fixed editor performance issues in Safari for posts with HTML or Markdown cards (#20806)

ref https://linear.app/tryghost/issue/ONC-261

- Previous method of hiding the second Lexical instance using `width:
0`, `height: 0`, and `overflow: hidden` caused CPU usage to spike,
likely due to CodeMirror continuously processing the element.
This commit is contained in:
Ronald Langeveld 2024-08-21 16:42:22 +07:00
parent eecd79a875
commit 27ff27ce76

View File

@ -680,7 +680,7 @@ export default class KoenigLexicalEditor extends Component {
const KGEditorComponent = ({isInitInstance}) => {
return (
<div data-secondary-instance={isInitInstance ? true : false} style={isInitInstance ? {width: 0, height: 0, overflow: 'hidden'} : {}}>
<div data-secondary-instance={isInitInstance ? true : false} style={isInitInstance ? {display: 'none'} : {}}>
<KoenigComposer
editorResource={this.editorResource}
cardConfig={cardConfig}