mirror of
https://github.com/zadam/trilium.git
synced 2025-10-06 13:39:51 +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,
|
...builtinStyles,
|
||||||
position: "relative",
|
position: "relative",
|
||||||
}} onClick={(e) => {
|
}} 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) {
|
if (value && onSelect) {
|
||||||
onSelect(value);
|
onSelect(value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default function SearchDefinitionTab({ note, ntxId }: TabContext) {
|
||||||
|
|
||||||
for (const searchOption of SEARCH_OPTIONS) {
|
for (const searchOption of SEARCH_OPTIONS) {
|
||||||
const attr = note.getAttribute(searchOption.attributeType, searchOption.attributeName);
|
const attr = note.getAttribute(searchOption.attributeType, searchOption.attributeName);
|
||||||
if (attr && searchOption.component) {
|
if (attr) {
|
||||||
activeOptions.push(searchOption);
|
activeOptions.push(searchOption);
|
||||||
} else {
|
} else {
|
||||||
availableOptions.push(searchOption);
|
availableOptions.push(searchOption);
|
||||||
|
|
Loading…
Add table
Reference in a new issue