fix: reload tabIndex after tags expansion

This commit is contained in:
Antonella Sgarlatta
2021-06-02 18:59:27 -03:00
parent 595b44dfee
commit f9c2b19eac
2 changed files with 5 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ type Props = {
export const NoteTag: FunctionalComponent<Props> = ({ appState, tag }) => { export const NoteTag: FunctionalComponent<Props> = ({ appState, tag }) => {
const { const {
tags, tags,
tagsContainerExpanded,
tagsContainerMaxWidth, tagsContainerMaxWidth,
} = appState.activeNote; } = appState.activeNote;
@@ -48,7 +49,7 @@ export const NoteTag: FunctionalComponent<Props> = ({ appState, tag }) => {
useEffect(() => { useEffect(() => {
reloadOverflowed(); reloadOverflowed();
}, [reloadOverflowed, tags, tagsContainerMaxWidth]); }, [reloadOverflowed, tags, tagsContainerExpanded, tagsContainerMaxWidth]);
const contextMenuListener = (event: MouseEvent) => { const contextMenuListener = (event: MouseEvent) => {
event.preventDefault(); event.preventDefault();

View File

@@ -134,6 +134,9 @@ export class ActiveNoteState {
} }
isTagOverflowed(tag: SNTag): boolean { isTagOverflowed(tag: SNTag): boolean {
if (this.tagsContainerExpanded) {
return false;
}
const tagElement = this.getTagElement(tag); const tagElement = this.getTagElement(tag);
return tagElement ? this.isElementOverflowed(tagElement) : false; return tagElement ? this.isElementOverflowed(tagElement) : false;
} }