From 658113f1b7ed49d110fb13e238d32555d59ecd61 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Sun, 12 Jan 2025 22:18:52 +0800 Subject: [PATCH] table: Revert deferred render scrollbr for table. This will make scrollbar on the top, even there have other element cover it. --- crates/ui/src/table.rs | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/crates/ui/src/table.rs b/crates/ui/src/table.rs index 56ca3cbd..b66dbb18 100644 --- a/crates/ui/src/table.rs +++ b/crates/ui/src/table.rs @@ -11,8 +11,8 @@ use crate::{ Icon, IconName, Sizable, Size, StyleSized as _, }; use gpui::{ - actions, canvas, deferred, div, prelude::FluentBuilder, px, uniform_list, AppContext, Axis, - Bounds, Div, DragMoveEvent, Edges, Entity, EntityId, EventEmitter, FocusHandle, FocusableView, + actions, canvas, div, prelude::FluentBuilder, px, uniform_list, AppContext, Axis, Bounds, Div, + DragMoveEvent, Edges, Entity, EntityId, EventEmitter, FocusHandle, FocusableView, InteractiveElement, IntoElement, KeyBinding, ListSizingBehavior, MouseButton, ParentElement, Pixels, Point, Render, ScrollHandle, ScrollStrategy, SharedString, Stateful, StatefulInteractiveElement as _, Styled, UniformListScrollHandle, ViewContext, @@ -1249,19 +1249,14 @@ where |_, _, _| {}, )) .child( - // use deferred to render the scrollbar for - // avoid some custom element overflow the scrollbar. - deferred( - div() - .absolute() - .top_0() - .size_full() - .child(self.render_horizontal_scrollbar(cx)) - .when(rows_count > 0, |this| { - this.children(self.render_scrollbar(cx)) - }), - ) - .with_priority(0), + div() + .absolute() + .top_0() + .size_full() + .child(self.render_horizontal_scrollbar(cx)) + .when(rows_count > 0, |this| { + this.children(self.render_scrollbar(cx)) + }), ) // Click out to cancel right clicked row .when(self.right_clicked_row.is_some(), |this| {