🐛 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 committed by GitHub
parent 54b0b87633
commit 3645fd8a5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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}