TagInput view
A field that collects a set of short tokens.
A view survives a frame. Hold it in an Entity with cx.new(..) and reach it with .update(..).
use gpui_kit::controls::TagInput;
Construct
new(ident: impl Into<Ident>, window: &mut Window, cx: &mut Context<Self>) -> SelfOptions
Chain onto the value.
tags(tags: impl IntoIterator<Item = impl Into<SharedString>>) -> Self
placeholder(placeholder: impl Into<SharedString>) -> Self
max(max: usize) -> Self
invalid(invalid: bool) -> SelfCommands
Need a Context, so they need a view.
set_tags(tags: Vec<SharedString>, cx: &mut Context<Self>)
set_disabled(disabled: bool, cx: &mut Context<Self>)Queries
Only answer; they change nothing.
current() -> &[SharedString]
field() -> &Entity<TextInput>
targeted() -> Option<&SharedString>
refusal() -> Option<&SharedString>Reports
The variants of the event it emits. It never applies the change itself.
- Added
- Removed
- Duplicate
- Refused
Rendered by
Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.