mirror of
https://github.com/zadam/trilium.git
synced 2025-09-29 10:05:49 +08:00
chore(react): fix some more type errors
This commit is contained in:
parent
28a472782f
commit
2bb66a7526
2 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue