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(|_, _| {
Button::new("like")
.tab_stop(false)
.icon(IconName::Heart)
.with_variant(ButtonVariant::Ghost)
.size(px(18.))

View file

@ -261,8 +261,11 @@ impl ColorPicker {
.shadow_xs()
})
.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.state.update(cx, |input, cx| {
input.set_value(color.to_hex(), window, cx);
});
cx.notify();
}))
.on_click(window.listener_for(
@ -329,7 +332,7 @@ impl ColorPicker {
.size_5()
.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(
Button::new("prev")
.icon(IconName::ArrowLeft)
.tab_stop(false)
.ghost()
.disabled(disabled)
.with_size(icon_size)
@ -642,6 +643,7 @@ impl Calendar {
.ghost()
.label(state.month_name(0))
.compact()
.tab_stop(false)
.with_size(self.size)
.selected(view_mode.is_month())
.on_click(window.listener_for(
@ -661,6 +663,7 @@ impl Calendar {
.ghost()
.label(current_year.to_string())
.compact()
.tab_stop(false)
.with_size(self.size)
.selected(view_mode.is_year())
.on_click(window.listener_for(
@ -696,6 +699,7 @@ impl Calendar {
Button::new("next")
.icon(IconName::ArrowRight)
.ghost()
.tab_stop(false)
.disabled(disabled)
.with_size(icon_size)
.when(view_mode.is_day(), |this| {

View file

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