BaseTextFieldView
Base class for text field UI elements with autocomplete functionality.
Provides a foundation for text input fields with features like:
- Text editing with EditText integration
- Autocomplete suggestions with fuzzy search
- Keyboard navigation for suggestions
- Customizable value submission and validation
- Integration with the field system for UI forms
This is an abstract base class meant to be extended by concrete implementations like TextFieldView, ColorFieldView, etc.
Instance Members
The current text value displayed in the field
Array of autocomplete suggestion candidates. When set, enables autocomplete functionality with fuzzy search.
Delay in seconds before showing autocomplete suggestions after typing
Maximum number of autocomplete suggestions to display
Whether to show autocomplete suggestions when the field gains focus
Whether to clip suggestions dropdown to scrolling container bounds
Hook called when the text value changes. Updates the internal text value and calls setValue.
Name | Type | Description |
---|---|---|
field |
BaseTextFieldView | The field instance (this) |
textValue |
String | The new text value |
Hook for setting the underlying value from text. Override this to convert text to the appropriate data type.
Name | Type | Description |
---|---|---|
field |
BaseTextFieldView | The field instance (this) |
value |
Dynamic | The value to set (typically string) |
Hook for clearing/resetting the field value. Override this to handle empty field state.
Name | Type | Description |
---|---|---|
field |
BaseTextFieldView | The field instance (this) |
Hook called when the user submits the field (e.g., pressing Enter). Override this to handle form submission or value confirmation.
Name | Type | Description |
---|---|---|
field |
BaseTextFieldView | The field instance (this) |
Name | Type |
---|---|
x |
Float |
y |
Float |
Returns |
---|
Bool |
Name | Type |
---|---|
scanCode |
ceramic.ScanCode |
Returns |
---|
Bool |
Name | Type |
---|---|
keyCode |
ceramic.KeyCode |
Returns |
---|
Bool |
Private Members
Maximum height of the autocomplete suggestions dropdown in pixels
When forcing suggestions display, show all candidates if fewer than this count
Height of each suggestion item in the dropdown
Flag tracking if text is being edited in the current frame
Flag tracking if suggestions are visible in the current frame
Key bindings for text selection and autocomplete shortcuts
The TextView component for displaying text
The EditText component for text input when focused
Processed candidates with normalized search strings
The dropdown list view for showing suggestions
Container view for positioning the suggestions dropdown
Current filtered list of suggestions to display
Transforms text for autocomplete matching. Replaces spaces with underscores for better fuzzy matching.
Name | Type | Description |
---|---|---|
text |
String | The text to transform |
Returns | Description |
---|---|
String | The transformed text |
Event when textValue field changes.
Name | Type |
---|---|
current |
String |
previous |
String |
Name | Type |
---|---|
focused |
Bool |
prevFocused |
Bool |
Timer cancellation function for autocomplete delay
Name | Type |
---|---|
text |
String |
Updates the autocomplete suggestions based on current text. Uses fuzzy search to filter candidates.
Name | Type | Default | Description |
---|---|---|---|
force |
Bool | false |
Whether to force showing suggestions even with empty/full matches |
Name | Type |
---|---|
key |
ceramic.Key |
Name | Type |
---|---|
value |
String |
prevValue |
String |
Name | Type |
---|---|
value |
String |
Name | Type |
---|---|
item |
String |
query |
String |
Returns |
---|
Float |
Returns |
---|
Float |
Sets up keyboard shortcuts for the text field.
- Cmd/Ctrl+A: Select all text
- Cmd/Ctrl+Space: Force show autocomplete suggestions
Creates a new BaseTextFieldView. Sets up update handlers and autocomplete functionality.
Metadata
Name | Parameters |
---|---|
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |
:build |
tracker.macros.ObservableMacro.build() |
:autoBuild |
tracker.macros.ObservableMacro.build() |