Fix on_action on focusable

We were accidentally dropping the key context
This commit is contained in:
Conrad Irwin 2023-11-13 12:48:36 -07:00
parent 2625051f75
commit 7e7b065535
6 changed files with 34 additions and 54 deletions

View file

@ -1,8 +1,7 @@
use editor::Editor;
use gpui::{
div, uniform_list, Component, Div, FocusableKeyDispatch, ParentElement, Render,
StatefulInteractivity, StatelessInteractive, Styled, Task, UniformListScrollHandle, View,
ViewContext, VisualContext, WindowContext,
div, uniform_list, Component, Div, ParentElement, Render, StatelessInteractive, Styled, Task,
UniformListScrollHandle, View, ViewContext, VisualContext, WindowContext,
};
use std::cmp;
use theme::ActiveTheme;
@ -137,13 +136,11 @@ impl<D: PickerDelegate> Picker<D> {
}
impl<D: PickerDelegate> Render for Picker<D> {
type Element = Div<Self, StatefulInteractivity<Self>, FocusableKeyDispatch<Self>>;
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
div()
.context("picker")
.id("picker-container")
.focusable()
.size_full()
.on_action(Self::select_next)
.on_action(Self::select_prev)