i18n, a11y, IME · palette copy reads i18n with builtin en/zh; dialog and palette Enter run on the field's key-down action, so an IME-kept Enter never submits; Button, IconButton, TextInput, Tabs, EditorTabs, StatusBarItem and palette rows name their role and label

This commit is contained in:
ZacharyZhang-NY committed 2026-10-02 12:58:43 -04:00
1 parent 8fd7b8ab87
commit 4580e3b075
15 files changed
+257 -75

No files matched your search

+7 -2
View File
@@ -1,7 +1,7 @@
use gpui::{
App, ClipboardItem, Context, CursorStyle, InteractiveElement, IntoElement, KeyBinding,
MouseButton, MouseDownEvent, MouseMoveEvent, ParentElement, Render, Styled, Window, actions,
div,
MouseButton, MouseDownEvent, MouseMoveEvent, ParentElement, Render, Role,
StatefulInteractiveElement, Styled, Window, actions, div, prelude::*,
};
use super::{
@@ -359,6 +359,11 @@ impl Render for TextInput {
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
div()
.id("ely-text-input")
.role(Role::TextInput)
.when(!self.placeholder.is_empty(), |el| {
el.aria_label(self.placeholder.clone())
})
.when(!self.masked, |el| el.aria_value(self.text.clone()))
.key_context(CONTEXT)
.track_focus(&self.focus)
.cursor(if self.disabled {