File tree 1 file changed +4
-4
lines changed
src/lib/components/modes/treemode
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1783
1783
// TODO: find a better way to restore focus
1784
1784
// TODO: implement a proper TypeScript solution to check whether this is an element with blur, focus, select
1785
1785
const activeElement = document .activeElement as HTMLInputElement
1786
- if (activeElement && activeElement .blur && activeElement .focus ) {
1786
+ if (activeElement && activeElement .blur && activeElement .select ) {
1787
1787
activeElement .blur ()
1788
1788
setTimeout (() => {
1789
1789
handleUndo ()
1790
- setTimeout (() => activeElement .select ())
1790
+ setTimeout (() => activeElement ? .select ())
1791
1791
})
1792
1792
} else {
1793
1793
handleUndo ()
1800
1800
// TODO: find a better way to restore focus
1801
1801
// TODO: implement a proper TypeScript solution to check whether this is an element with blur, focus, select
1802
1802
const activeElement = document .activeElement as HTMLInputElement
1803
- if (activeElement && activeElement .blur && activeElement .focus ) {
1803
+ if (activeElement && activeElement .blur && activeElement .select ) {
1804
1804
activeElement .blur ()
1805
1805
setTimeout (() => {
1806
1806
handleRedo ()
1807
- setTimeout (() => activeElement .select ())
1807
+ setTimeout (() => activeElement ? .select ())
1808
1808
})
1809
1809
} else {
1810
1810
handleRedo ()
You can’t perform that action at this time.
0 commit comments