chore: Disable tab stop for some popover elements. (#1306)

This commit is contained in:
Jason Lee 2025-09-29 18:11:25 +08:00 committed by GitHub
parent 03cf48a783
commit f92944546f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 2 deletions

View file

@ -84,6 +84,7 @@ impl ListDelegate for ListItemDeletegate {
) )
.suffix(|_, _| { .suffix(|_, _| {
Button::new("like") Button::new("like")
.tab_stop(false)
.icon(IconName::Heart) .icon(IconName::Heart)
.with_variant(ButtonVariant::Ghost) .with_variant(ButtonVariant::Ghost)
.size(px(18.)) .size(px(18.))

View file

@ -261,8 +261,11 @@ impl ColorPicker {
.shadow_xs() .shadow_xs()
}) })
.active(|this| this.border_color(color.darken(0.5)).bg(color.darken(0.2))) .active(|this| this.border_color(color.darken(0.5)).bg(color.darken(0.2)))
.on_mouse_move(window.listener_for(&state, move |state, _, _, cx| { .on_mouse_move(window.listener_for(&state, move |state, _, window, cx| {
state.hovered_color = Some(color); state.hovered_color = Some(color);
state.state.update(cx, |input, cx| {
input.set_value(color.to_hex(), window, cx);
});
cx.notify(); cx.notify();
})) }))
.on_click(window.listener_for( .on_click(window.listener_for(
@ -329,7 +332,7 @@ impl ColorPicker {
.size_5() .size_5()
.rounded(cx.theme().radius), .rounded(cx.theme().radius),
) )
.child(TextInput::new(&state.read(cx).state)), .child(TextInput::new(&state.read(cx).state).small()),
) )
}) })
} }

View file

@ -619,6 +619,7 @@ impl Calendar {
.child( .child(
Button::new("prev") Button::new("prev")
.icon(IconName::ArrowLeft) .icon(IconName::ArrowLeft)
.tab_stop(false)
.ghost() .ghost()
.disabled(disabled) .disabled(disabled)
.with_size(icon_size) .with_size(icon_size)
@ -642,6 +643,7 @@ impl Calendar {
.ghost() .ghost()
.label(state.month_name(0)) .label(state.month_name(0))
.compact() .compact()
.tab_stop(false)
.with_size(self.size) .with_size(self.size)
.selected(view_mode.is_month()) .selected(view_mode.is_month())
.on_click(window.listener_for( .on_click(window.listener_for(
@ -661,6 +663,7 @@ impl Calendar {
.ghost() .ghost()
.label(current_year.to_string()) .label(current_year.to_string())
.compact() .compact()
.tab_stop(false)
.with_size(self.size) .with_size(self.size)
.selected(view_mode.is_year()) .selected(view_mode.is_year())
.on_click(window.listener_for( .on_click(window.listener_for(
@ -696,6 +699,7 @@ impl Calendar {
Button::new("next") Button::new("next")
.icon(IconName::ArrowRight) .icon(IconName::ArrowRight)
.ghost() .ghost()
.tab_stop(false)
.disabled(disabled) .disabled(disabled)
.with_size(icon_size) .with_size(icon_size)
.when(view_mode.is_day(), |this| { .when(view_mode.is_day(), |this| {

View file

@ -458,6 +458,7 @@ impl RenderOnce for DatePicker {
Button::new(("preset", i)) Button::new(("preset", i))
.small() .small()
.ghost() .ghost()
.tab_stop(false)
.label(preset.label.clone()) .label(preset.label.clone())
.on_click(window.listener_for( .on_click(window.listener_for(
&self.state, &self.state,