|
4 | 4 | ["@radix-ui/react-dropdown-menu" :as DropdownMenu]
|
5 | 5 | [re-frame.core :as rf]
|
6 | 6 | [reagent.core :as ra]
|
| 7 | + [renderer.app.events :as-alias app.e] |
7 | 8 | [renderer.document.events :as-alias e]
|
8 | 9 | [renderer.document.subs :as-alias s]
|
9 | 10 | [renderer.history.events :as-alias history.e]
|
|
108 | 109 | (let [dropped-id (-> (.-dataTransfer evt) (.getData "id") uuid)]
|
109 | 110 | (.preventDefault evt)
|
110 | 111 | (reset! dragged-over? false)
|
111 |
| - (rf/dispatch [::e/swap-position dropped-id id])))} |
| 112 | + (rf/dispatch [::e/swap-position dropped-id id]))) |
| 113 | + :ref (fn [this] |
| 114 | + (when (and this active?) |
| 115 | + (rf/dispatch [::app.e/scroll-into-view this])))} |
112 | 116 | [:span.truncate.pointer-events-none title]
|
113 | 117 | [close-button id saved?]]]
|
114 | 118 | [:> ContextMenu/Portal
|
|
124 | 128 | (let [documents @(rf/subscribe [::s/entities])
|
125 | 129 | tabs @(rf/subscribe [::s/tabs])
|
126 | 130 | active-id @(rf/subscribe [::s/active-id])]
|
127 |
| - [:div.flex.drag.justify-between |
128 |
| - [:div.flex.flex-1.gap-px.overflow-hidden |
129 |
| - (for [document-id tabs] |
130 |
| - (let [title (:title (get documents document-id)) |
131 |
| - active? (= document-id active-id)] |
132 |
| - ^{:key (str document-id)} [tab document-id title active?]))] |
| 131 | + [:div.flex.justify-between.gap-px |
| 132 | + [ui/scroll-area |
| 133 | + [:div.flex.flex-1.gap-px |
| 134 | + {:class "h-[41px]"} |
| 135 | + (for [document-id tabs] |
| 136 | + (let [title (:title (get documents document-id)) |
| 137 | + active? (= document-id active-id)] |
| 138 | + ^{:key (str document-id)} [tab document-id title active?])) |
| 139 | + [:div.drag.flex-1]]] |
133 | 140 | [:div.toolbar
|
134 | 141 | [:> DropdownMenu/Root
|
135 | 142 | [:> DropdownMenu/Trigger
|
|
0 commit comments