Skip to content

Commit

Permalink
adress comments
Browse files Browse the repository at this point in the history
  • Loading branch information
potatowagon committed May 29, 2024
1 parent 0b52e13 commit d438edd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions packages/lexical-list/src/LexicalListItemNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import type {

import {
addClassNamesToElement,
isHTMLElement,
removeClassNamesFromElement,
} from '@lexical/utils';
import {
Expand Down Expand Up @@ -493,14 +492,14 @@ function updateListItemChecked(
}
}

function $convertListItemElement(domNode: Node): DOMConversionOutput {
function $convertListItemElement(domNode: HTMLElement): DOMConversionOutput {
const ariaCheckedAttr = domNode.getAttribute('aria-checked');
const checked =
isHTMLElement(domNode) &&
(domNode.getAttribute('aria-checked') === 'true'
ariaCheckedAttr === 'true'
? true
: domNode.getAttribute('aria-checked') === 'false'
: ariaCheckedAttr === 'false'
? false
: undefined);
: undefined;
return {node: $createListItemNode(checked)};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-playground/src/nodes/ImageNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function isGoogleDocCheckboxImg(img: HTMLImageElement): boolean {
img.parentElement != null &&
img.parentElement.tagName === 'LI' &&
img.previousSibling === null &&
img.src.startsWith('data:image/png;base64,iVBOR')
img.getAttribute('aria-roledescription') === 'checkbox'
);
}

Expand Down

0 comments on commit d438edd

Please sign in to comment.