From d8bdd09eb0f21d0e30aa42164aecd8462e7e9bc9 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Sat, 16 Sep 2023 05:00:10 +0800 Subject: [PATCH] fix: ensure hightlight is visible --- core/modules/widgets/blockid.js | 5 ++++- themes/tiddlywiki/vanilla/base.tid | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/blockid.js b/core/modules/widgets/blockid.js index 959b53243..eaec7a537 100644 --- a/core/modules/widgets/blockid.js +++ b/core/modules/widgets/blockid.js @@ -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; }; diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index b7cb1a3fc..e957ea0f9 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -2416,9 +2416,11 @@ html body.tc-body.tc-single-tiddler-window { @keyframes fadeHighlight { 0% { background-color: <>; + border-color: <>; } 100% { background-color: transparent; + border-color: transparent; } }