chore(react): fix some more type errors

This commit is contained in:
Elian Doran 2025-08-27 18:27:47 +03:00
parent 28a472782f
commit 2bb66a7526
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View file

@ -54,7 +54,8 @@ export default function FormList({ children, onSelect, style, fullHeight }: Form
...builtinStyles,
position: "relative",
}} onClick={(e) => {
const value = (e.target as HTMLElement).closest("a.dropdown-item")?.dataset?.value;
const dropdownItem = (e.target as HTMLElement).closest(".dropdown-item") as HTMLElement | null;
const value = dropdownItem?.dataset?.value;
if (value && onSelect) {
onSelect(value);
}

View file

@ -34,7 +34,7 @@ export default function SearchDefinitionTab({ note, ntxId }: TabContext) {
for (const searchOption of SEARCH_OPTIONS) {
const attr = note.getAttribute(searchOption.attributeType, searchOption.attributeName);
if (attr && searchOption.component) {
if (attr) {
activeOptions.push(searchOption);
} else {
availableOptions.push(searchOption);