fix: prevent scroll reset when hovering over hidden annotation
Keep button container always rendered but use visibility:hidden to hide buttons instead of conditionally rendering them. This preserves DOM structure and prevents scroll position reset on hover. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
06b28e2a9c
commit
89533a13cd
1 changed files with 6 additions and 7 deletions
|
|
@ -817,13 +817,12 @@
|
||||||
[:span.ann-title {:style {:font-size 10}}
|
[:span.ann-title {:style {:font-size 10}}
|
||||||
[:span.ann-swatch {:style {:background (:color a)}}]
|
[:span.ann-swatch {:style {:background (:color a)}}]
|
||||||
(:name a)]
|
(:name a)]
|
||||||
(when @hov?
|
[:div {:style {:display "flex" :gap "2px" :visibility (if @hov? "visible" "hidden")}}
|
||||||
[:div {:style {:display "flex" :gap "2px"}}
|
[:button.expand-btn {:title "Expand" :on-click #(rf/dispatch [::events/expand (:id a)])}
|
||||||
[:button.expand-btn {:title "Expand" :on-click #(rf/dispatch [::events/expand (:id a)])}
|
"⤢"]
|
||||||
"⤢"]
|
[:button.edit-btn {:title "Edit"
|
||||||
[:button.edit-btn {:title "Edit"
|
:on-click #(rf/dispatch [::events/edit-draft (:id a)])}
|
||||||
:on-click #(rf/dispatch [::events/edit-draft (:id a)])}
|
"✎"]]])
|
||||||
"✎"]])])
|
|
||||||
;; Normal annotation: full card
|
;; Normal annotation: full card
|
||||||
[:div.ann {:id (str "ann-" (name (:id a)))
|
[:div.ann {:id (str "ann-" (name (:id a)))
|
||||||
:class (when (contains? active-set (:id a)) "active")
|
:class (when (contains? active-set (:id a)) "active")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue