Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/component/src/combobox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use rust_i18n::t;

pub use crate::select::Caret;

use crate::FocusableExt as _;
use crate::ThemeStyled as _;
use crate::{
ActiveTheme, Disableable, ElementExt as _, Icon, IconName, IndexPath, Sizable, Size,
Expand Down Expand Up @@ -1054,7 +1055,11 @@ fn render_popup_shell<D: SearchableListDelegate + 'static>(
})
.popover_style(cx)
.child(
// The popup is the keyboard's only target here, and the
// trigger already wears the ring: a second one inside would be
// noise.
List::new(list)
.focus_ring(false)
.when_some(search_placeholder, |this, placeholder| {
this.search_placeholder(placeholder)
})
Expand Down
7 changes: 6 additions & 1 deletion crates/component/src/input/popovers/code_action_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub(crate) use gpui_base::input::CodeActionItem;
const MAX_MENU_WIDTH: Pixels = px(320.);
const MAX_MENU_HEIGHT: Pixels = px(480.);

use crate::FocusableExt as _;
use crate::{
ActiveTheme, IndexPath, Selectable, actions, h_flex,
input::{self, EditorState, popovers::editor_popover},
Expand Down Expand Up @@ -320,7 +321,11 @@ impl Render for CodeActionMenu {
.top(pos.y)
.max_w(max_width)
.min_w(px(120.))
.child(List::new(&self.list).max_h(MAX_MENU_HEIGHT))
.child(
List::new(&self.list)
.focus_ring(false)
.max_h(MAX_MENU_HEIGHT),
)
.on_mouse_down_out(cx.listener(|this, _, _, cx| {
this.hide(cx);
})),
Expand Down
7 changes: 6 additions & 1 deletion crates/component/src/input/popovers/completion_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use lsp_types::CompletionItem;
const MAX_MENU_HEIGHT: Pixels = px(240.);
const POPOVER_GAP: Pixels = px(4.);

use crate::FocusableExt as _;
use crate::{
ActiveTheme, IndexPath, Selectable, actions, h_flex,
input::{
Expand Down Expand Up @@ -401,7 +402,11 @@ impl Render for CompletionMenu {
editor_popover("completion-menu", cx)
.max_w(max_width)
.min_w(px(120.))
.child(List::new(&self.list).max_h(MAX_MENU_HEIGHT)),
.child(
List::new(&self.list)
.focus_ring(false)
.max_h(MAX_MENU_HEIGHT),
),
)
.when_some(selected_documentation, |this, documentation| {
let mut doc = match documentation {
Expand Down
9 changes: 8 additions & 1 deletion crates/component/src/list/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,15 @@ impl RowsCache {
///
/// Empty rows section are skipped.
pub(crate) fn next(&self, path: Option<IndexPath>) -> IndexPath {
// Nothing selected yet: start at the first row that exists, which is
// not row 0 of section 0 when that section is empty.
let Some(mut path) = path else {
return IndexPath::default();
return self
.entities
.iter()
.find(|entry| entry.is_entry())
.map(|entry| entry.index())
.unwrap_or_default();
};

let Some(pos) = self.position_of(&path) else {
Expand Down
Loading
Loading