Skip to content

Commit

Permalink
🐛 Fixed editor performance issues in Safari for posts with HTML or Ma…
Browse files Browse the repository at this point in the history
…rkdown 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.
  • Loading branch information
ronaldlangeveld authored Aug 21, 2024
1 parent 54b0b87 commit 3645fd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ghost/admin/app/components/koenig-lexical-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 3645fd8

Please sign in to comment.