Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
BitPhinix committed Jul 12, 2022
1 parent 6ed1388 commit 89bbcfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export const Editable = (props: EditableProps) => {
ReactEditor.hasDOMNode(editor, anchorNode)
) {
// Find the last text node inside the anchor.
const lastText = window.document
const lastText = window?.document
.createTreeWalker(anchorNode, NodeFilter.SHOW_TEXT)
.lastChild() as DOMText | null

Expand All @@ -402,7 +402,7 @@ export const Editable = (props: EditableProps) => {
if (
native &&
node.parentElement &&
window.getComputedStyle(node.parentElement).whiteSpace === 'pre'
window?.getComputedStyle(node.parentElement)?.whiteSpace === 'pre'
) {
const block = Editor.above(editor, {
at: anchor.path,
Expand Down

0 comments on commit 89bbcfb

Please sign in to comment.