Skip to content

Commit

Permalink
Replace contenteditable hack
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed Nov 9, 2023
1 parent 34b866e commit 6bad6af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 0 additions & 6 deletions package/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,6 @@ const createEditor = (
dispatchSelection()
preventDefault(e)
})
// Hack to fix an obscure fontsize bug on iOS Safari when overflowing horizontally
if (isWebKit) {
scrollContainer.contentEditable = <any>true
wrapper.contentEditable = <any>false
scrollContainer.tabIndex = -1
}

containerEl?.append(scrollContainer)
options && setOptions(options)
Expand Down
3 changes: 2 additions & 1 deletion package/src/layout.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.prism-code-editor {
overflow: auto;
display: grid;
outline: 0;
background: var(--editor__bg);
line-height: 1.4;
--_pse: var(--padding-inline, 0.75em);
Expand All @@ -23,6 +22,8 @@
margin: 0.5em 0;
position: relative;
pointer-events: none;
-webkit-text-size-adjust: none;
text-size-adjust: none;
}

.prism-code-editor textarea {
Expand Down

0 comments on commit 6bad6af

Please sign in to comment.