fix: ensure hightlight is visible

This commit is contained in:
linonetwo 2023-09-16 05:00:10 +08:00
parent 6b6124369c
commit d8bdd09eb0
2 changed files with 6 additions and 1 deletions

View File

@ -45,7 +45,10 @@ BlockIdWidget.prototype.hookFocusElementEvent = function(event) {
element.focus({ focusVisible: true });
// toggle class to trigger highlight animation
$tw.utils.removeClass(element,"tc-focus-highlight");
$tw.utils.addClass(element,"tc-focus-highlight");
// Using setTimeout to ensure the removal takes effect before adding the class again.
setTimeout(function() {
$tw.utils.addClass(element,"tc-focus-highlight");
}, 50);
return false;
};

View File

@ -2416,9 +2416,11 @@ html body.tc-body.tc-single-tiddler-window {
@keyframes fadeHighlight {
0% {
background-color: <<colour highlight-background>>;
border-color: <<colour highlight-background>>;
}
100% {
background-color: transparent;
border-color: transparent;
}
}