TextBox JAVASCRIPT UI Component API

TextBox Javascript API

Class

TextBox

TextBox is an input field with auto-suggest options.

Selector

smart-text-box

Properties

AanimationControls the animation mode for the component. You can retrieve the current mode or assign a new one. Setting this property to 'none' will disable all animations.
AautoFocusSpecifies whether the text box should automatically receive keyboard focus when the page loads, allowing users to start typing immediately without clicking inside the box.
AautoCompleteSpecifies the autocomplete mode used to filter and display suggestions from the dataSource. The selected autocomplete mode determines how input text is matched against the available items, showing only those entries that meet the criteria—for example, items that start with, contain, or exactly match the user's input. This setting helps control the relevance and behavior of suggestion lists shown to the user while typing.
AautoCompleteDelaySpecifies the duration (in milliseconds) to wait after the user stops typing before displaying the dropdown with autocomplete suggestions. This delay helps control how quickly the matching results appear, improving performance and user experience by preventing unnecessary searches while the user is still typing.
DdataSourceSpecifies the data source that populates the ComboBox options. The dataSource property accepts multiple types:- 'Array of strings or numbers:' Each item will be displayed as both the label and value of a list item.- 'Array of objects:' Each object should contain properties—such as label (displayed text) and value (item value)—that define the corresponding list item’s display and value.- 'Callback function:' You can provide a function that returns an array of items in either of the above forms. This allows for dynamic or asynchronous data loading.This flexible approach lets you easily integrate static lists, complex objects, or data fetched from external sources into the ComboBox.
DdisabledDetermines whether the element is active and interactive (enabled) or inactive and unresponsive to user interactions (disabled). When set to "disabled," the element cannot be focused, clicked, or edited by the user.
DdisplayLoadingIndicatorSpecifies whether a visual indicator (such as a loading spinner or progress bar) will be displayed while filtering data or loading items from a remote source. This helps inform users that a background operation is in progress.
DdisplayMemberSets or retrieves the displayMember property. The displayMember determines which property of each object in the data source collection (defined by the 'dataSource' property) will be used for display purposes in the user interface. By specifying the name of a property here, you control which value from each data source item is shown to users (e.g., displaying a "name" property from a list of user objects).
DdisplayModeSpecifies the visual presentation of characters within the input field, such as whether the characters are visible as plain text, masked (e.g., as password dots), or formatted in a particular style. This attribute controls how users see the inputted content while typing or reviewing their entries.
DdropDownAppendToSpecifies the parent container to which the dropdown menu is appended in the DOM. By default, the dropdown is rendered within its original parent element. However, if an ancestor element has restricted overflow (e.g., 'overflow: hidden' or 'overflow: auto'), the dropdown may be clipped and not display correctly. To resolve this, you can set the dropDownAppendTo property to ''body'', the ID of a specific HTML element, or a direct reference to an HTML element. When set, the dropdown will be moved to the specified container in the DOM, ensuring it displays properly regardless of overflow constraints in its ancestors. To restore the dropdown to its original parent, reset this property to null. This feature is especially useful for ensuring that dropdowns are visible and functional in complex layouts where parent elements limit visibility due to CSS overflow properties.
DdropDownHeightSpecifies the height of the dropdown menu. By default, this property is set to an empty string, which means the dropdown's height will be determined by a CSS variable. To customize the dropdown's height directly, you can assign a specific value (e.g., "200px" or "50%") to this property. Otherwise, leaving it empty enables the component to use the height defined by the associated CSS variable.
DdropDownMaxHeightDefines the maximum height for the dropdown menu. If no value is set (default is an empty string), the dropdown’s maximum height will be determined by a corresponding CSS variable instead. This allows for dynamic styling via CSS, while still providing the option to specify a fixed maximum height directly through this property.
DdropDownMaxWidthSpecifies the maximum width of the dropdown menu. By default, this property is set to an empty string, meaning that the dropdown's max-width is determined by a corresponding CSS variable. If a specific value (such as '300px' or '100%') is provided, it will override the CSS variable and directly set the maximum width of the dropdown.
DdropDownMinHeightDefines the minimum height of the dropdown menu. By default, this property is set to an empty string (""), which means the minimum height is not explicitly specified in the component and will instead be determined by the value of a related CSS variable. If a specific value (such as "200px" or "2rem") is provided, it will override the CSS variable and set the minimum height of the dropdown directly.
DdropDownMinWidthSpecifies the minimum width of the dropdown menu. By default, this property is set to an empty string, which means the dropdown's minimum width is determined by a corresponding CSS variable. If you provide a specific value (such as '200px' or '20rem'), it will override the CSS variable and set the dropdown's minimum width accordingly.
DdropDownOpenModeSpecifies the direction or animation style in which the dropdown menu appears when activated (e.g., opens upwards, downwards, or with a fade effect).
DdropDownOverlayWhen this property is enabled, opening the element’s dropdown will create a transparent overlay that covers the entire area between the dropdown and the rest of the webpage. This overlay ensures that any clicks outside the dropdown are intercepted by the overlay itself, rather than interacting with underlying DOM elements. As a result, clicking outside the dropdown can be handled consistently—for example, to close the dropdown—without triggering unintended interactions elsewhere on the page.
DdropDownPlaceholderSpecifies the placeholder text that appears in the dropdown menu when there are no available items to display. This text provides guidance or context to users, indicating that the dropdown is currently empty.
DdropDownPositionSpecifies the alignment and placement of the dropdown menu relative to its trigger element when the dropdown is opened, allowing you to control where the menu appears on the screen (e.g., above, below, left, or right of the trigger).
DdropDownWidthSpecifies the width of the dropdown menu. By default, this property is set to an empty string (""). When left empty, the dropdown's width is determined by a corresponding CSS variable, allowing for flexible styling through external or theme-based CSS. To explicitly set a custom width, provide a valid CSS width value (e.g., "200px", "50%").
EescKeyModeSpecifies how the element responds when the Escape key is pressed, such as closing a dialog, dismissing a modal, or performing a custom action.
EenterKeyBehaviorDefines how the "Enter" key functions within the application, such as whether it submits a form, inserts a new line, or triggers a specific action, depending on the context.
FformSpecifies the form element with which this element is associated, known as its "form owner." The value of this attribute must be the ID of a
element present in the same document. This allows the element to be associated with a specific form, even if it is not nested directly within the form’s markup.
HhintProvides supplemental helper text displayed beneath the element. This hint appears exclusively when the element is focused, offering contextual guidance to the user during interaction.
HhorizontalScrollBarVisibilityControls whether the horizontal scroll bar within the dropdown menu is visible. This setting allows you to enable or disable horizontal scrolling for dropdown content that extends beyond the visible area.
IinputMemberRepresents the property key of a List item's object that specifies which value should be displayed in the input field when a ListItem is selected. This property is useful when you want to show a value other than the default label—such as a unique identifier or another attribute—within the input. By default, the item's label is shown. Use this option to customize the displayed value based on a different property from your data objects.
IinputPurposeDefines the purpose of the input field and specifies the type of data expected, providing guidance to browsers and user agents for offering autofill suggestions. This property maps directly to the standard HTML autocomplete attribute, allowing developers to control whether and how a browser can automatically fill in the field based on the user's stored information. Possible values include generic options like 'on' and 'off', as well as more specific data types such as 'name', 'organization', 'email', 'street-address', and others, enabling enhanced user experience and data accuracy in forms.
IitemHeightSpecifies the height (in pixels) for each list item when rendering the list. This property is only applicable if list virtualization is enabled, as it allows the component to accurately calculate and display only the visible items for improved performance.
IitemMeasureModeSpecifies the algorithm used to calculate the width of each item, determining how item widths are measured and displayed within the layout. This setting influences whether widths are fixed, dynamic, or adapt based on content or container size.
IitemsA getter that retrieves and returns an array containing all the list item elements (e.g., '' elements) currently present within the dropdown menu. This allows easy access to all items displayed in the dropdown for further manipulation or inspection.
IitemTemplateThe itemTemplate property is a string specifying the id of an HTMLTemplateElement present in the DOM. This template is used to define and customize the structure and content of each item rendered within the list. By referencing the id of an HTMLTemplateElement, you can control how individual list items are displayed, allowing for flexible and reusable item layouts.
LlabelDisplays a small text label positioned above the element, typically used to provide additional context or information about the element’s purpose.
LloadingIndicatorPlaceholderSpecifies the text that appears alongside the loading indicator when the loader is visible and positioned at either the top or bottom of the container. This text provides context or status information to users while the loading process is ongoing.
LloadingIndicatorPositionSpecifies the screen location where the loading indicator will be displayed (e.g., top, bottom, center, etc.), allowing developers to control the visual placement of the loading element within the application's interface.
UunlockKeyDefines or retrieves the unlockKey, a unique code or token used to grant access to the product's features or functionality.
LlocaleSets or retrieves the current language for localization purposes. This property is used together with the messages property, which contains language-specific content or translations. Adjusting the language will determine which set of messages is displayed or utilized within the application.
LlocalizeFormatFunctionA callback function that allows you to define a custom format for messages returned by the Localization Module. This enables you to modify or enhance the localized messages—such as adding prefixes, changing text structure, or injecting dynamic values—before they are displayed to the user.
MmaxLengthSpecifies or retrieves the maximum number of characters allowed for user input in a text field. This limits how many characters a user can type or paste into the field.
MminLengthSpecifies or retrieves the minimum number of characters a user must type before the auto-complete feature is activated and suggestions are displayed.
MmessagesDefines or retrieves an object containing the set of strings (such as labels, tooltips, button text, and messages) used throughout the widget interface, allowing these strings to be localized for different languages. This property works together with the language property to ensure the widget’s text content is displayed in the appropriate language for users.
NnameSets or retrieves the name attribute of the element. The name attribute specifies a key associated with the element's value when submitting HTML forms, enabling server-side identification and processing of submitted data. This is essential for form controls such as inputs, selects, and textareas.
OopenedIndicates whether the dropdown menu is currently expanded (open) and visible to the user, or collapsed (closed) and hidden from view.
PplaceholderSpecifies the placeholder text that appears inside the input field when it is empty, providing guidance or an example of the expected input to the user.
RreadonlyPrevents any user interaction with the element, disabling actions such as clicking, focusing, hovering, or keyboard input. The element will not respond to any user events while this setting is applied.
RrightToLeftSets or retrieves a value that specifies whether the element’s content is aligned for right-to-left (RTL) text direction, supporting languages and locales such as Arabic or Hebrew. When enabled, the element’s layout and text flow will be adjusted to display content appropriately for RTL reading order.
RrequiredIndicates that the input field is required, meaning the user must provide a value in this field before the form can be submitted successfully. If the input is left empty, the form submission will be blocked and the user will be prompted to complete the required information.
RrequiredMessageDefines the custom error message displayed to users when the input is marked as required but no value has been entered. If the required field is left empty, this message will be shown to prompt the user to provide the necessary input.
SselectAllOnFocusSpecifies whether the entire content of the input field should automatically be highlighted (selected) when the input receives focus, allowing users to easily replace or copy the content.
TthemeSpecifies the theme to be applied, which controls the overall appearance and visual style of the element, including colors, fonts, and other stylistic details.
UunfocusableIf set to true, the element will be excluded from the tab order and cannot receive keyboard or programmatic focus. This means users will not be able to navigate to the element using the Tab key or set focus to it via scripts.
VvalueSets a new value for the element or retrieves its current value, depending on how the method is used. Useful for reading or updating the content, input, or state of form elements such as text fields, checkboxes, or select menus.
VvalueMemberSpecifies which property of each item object represents its value. The valueMember setting is particularly useful when binding the ListBox to data from a JSON file as its dataSource and you need to designate a specific property in the JSON objects to be used as the item's value. This is similar to how groupMember works, but instead of grouping items, valueMember tells the ListBox which property to use for the underlying value of each list item. For example, if your JSON objects have an "id" property, setting valueMember to "id" will store the value of the "id" property for each item in the ListBox.
VverticalScrollBarVisibilityControls whether the vertical scroll bar within the dropdown menu is visible. This property allows you to specify if users can scroll vertically to view additional dropdown options when the content overflows the visible area.

Events

CchangeThis event is triggered whenever the value in the Text Box changes and is confirmed by the user. Specifically, it fires under two conditions: 1. When the user moves focus away from the Text Box (on blur). 2. When the user presses the 'Enter' key while the Text Box is focused. This ensures that the event only occurs after the user has finished editing the text, rather than on every keystroke.
CchangingThis event is triggered each time a user releases a key (on the keyup event) within the TextBox, but only if the content of the TextBox has changed since the previous event.

Methods

CcloseCloses the drop-down menu associated with the input field. Note: The drop-down appears only when auto-complete functionality is enabled, allowing users to select from suggested options.
OopenExpands the drop-down menu, allowing users to view and select available options. This drop-down menu is displayed exclusively when the autocomplete feature is enabled, providing relevant suggestions based on user input.
RresetThis method resets the input field to its original, initial value, effectively clearing any changes made by the user and restoring the input to its default state as set when the component or page first loaded.

Properties

animation"none" | "simple" | "advanced"

Controls the animation mode for the component. You can retrieve the current mode or assign a new one. Setting this property to 'none' will disable all animations.

Allowed Values

  • "none" - animation is disabled
  • "simple" - ripple animation is disabled
  • "advanced" - all animations are enabled

Default value

"advanced"

Example

Set the animation property.

 <smart-text-box animation='none'></smart-text-box>

Set the animation property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.animation = 'simple';

Get the animation property.

 const textbox = document.querySelector('smart-text-box');
 let animation = textbox.animation;

autoFocusboolean

Specifies whether the text box should automatically receive keyboard focus when the page loads, allowing users to start typing immediately without clicking inside the box.

Default value

false

Example

Set the autoFocus property.

 <smart-text-box auto-focus></smart-text-box>

Set the autoFocus property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.autoFocus = false;

Get the autoFocus property.

 const textbox = document.querySelector('smart-text-box');
 let autoFocus = textbox.autoFocus;

autoComplete"none" | "auto" | "inline" | "manual"

Specifies the autocomplete mode used to filter and display suggestions from the dataSource. The selected autocomplete mode determines how input text is matched against the available items, showing only those entries that meet the criteria—for example, items that start with, contain, or exactly match the user's input. This setting helps control the relevance and behavior of suggestion lists shown to the user while typing.

Allowed Values

  • "none" - Auto complete is disabled.
  • "auto" - When the input matches one or many items from the dataSource the drop down opens and displays the matched items. The first suggested item is automatically highlighted as selected and becomes the value of the textbox when the combobox loses focus unless the user chooses a different item or changes the character string in the textbox.
  • "inline" - When the input matches one or many items from the dataSource the drop down opens and displays the matched items. The first suggested item is automatically highlighted as selected and becomes the value of the textbox when the combobox loses focus unless the user chooses a different item or changes the character string in the textbox. In addition to that a completion helper that appears next to the input cursor in the input. This helper shows the first possible match by completing the input text.
  • "manual" - When the input matches one or many items from the dataSource the drop down opens and displays the matched items.

Default value

"manual"

Example

Set the autoComplete property.

 <smart-text-box auto-complete='auto'></smart-text-box>

Set the autoComplete property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.autoComplete = 'manual';

Get the autoComplete property.

 const textbox = document.querySelector('smart-text-box');
 let autoComplete = textbox.autoComplete;

autoCompleteDelaynumber

Specifies the duration (in milliseconds) to wait after the user stops typing before displaying the dropdown with autocomplete suggestions. This delay helps control how quickly the matching results appear, improving performance and user experience by preventing unnecessary searches while the user is still typing.

Default value

100

Example

Set the autoCompleteDelay property.

 <smart-text-box auto-complete-delay='1000'></smart-text-box>

Set the autoCompleteDelay property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.autoCompleteDelay = 1100;

Get the autoCompleteDelay property.

 const textbox = document.querySelector('smart-text-box');
 let autoCompleteDelay = textbox.autoCompleteDelay;

dataSourceany

Specifies the data source that populates the ComboBox options. The dataSource property accepts multiple types:

- 'Array of strings or numbers:' Each item will be displayed as both the label and value of a list item.
- 'Array of objects:' Each object should contain properties—such as label (displayed text) and value (item value)—that define the corresponding list item’s display and value.
- 'Callback function:' You can provide a function that returns an array of items in either of the above forms. This allows for dynamic or asynchronous data loading.

This flexible approach lets you easily integrate static lists, complex objects, or data fetched from external sources into the ComboBox.

Example

Set the dataSource property.

 <smart-text-box data-source='["item 1", "item 2"]'></smart-text-box>

Set the dataSource property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dataSource = ["new item 1", "new item 2"];

Get the dataSource property.

 const textbox = document.querySelector('smart-text-box');
 let dataSource = textbox.dataSource;

disabledboolean

Determines whether the element is active and interactive (enabled) or inactive and unresponsive to user interactions (disabled). When set to "disabled," the element cannot be focused, clicked, or edited by the user.

Default value

false

Example

Set the disabled property.

 <smart-text-box disabled></smart-text-box>

Set the disabled property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.disabled = false;

Get the disabled property.

 const textbox = document.querySelector('smart-text-box');
 let disabled = textbox.disabled;

displayLoadingIndicatorboolean

Specifies whether a visual indicator (such as a loading spinner or progress bar) will be displayed while filtering data or loading items from a remote source. This helps inform users that a background operation is in progress.

Default value

false

Example

Set the displayLoadingIndicator property.

 <smart-text-box display-loading-indicator></smart-text-box>

Set the displayLoadingIndicator property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.displayLoadingIndicator = false;

Get the displayLoadingIndicator property.

 const textbox = document.querySelector('smart-text-box');
 let displayLoadingIndicator = textbox.displayLoadingIndicator;

displayMemberstring

Sets or retrieves the displayMember property. The displayMember determines which property of each object in the data source collection (defined by the 'dataSource' property) will be used for display purposes in the user interface. By specifying the name of a property here, you control which value from each data source item is shown to users (e.g., displaying a "name" property from a list of user objects).

Default value

""""

Example

Set the displayMember property.

 <smart-text-box display-member='label'></smart-text-box>

Set the displayMember property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.displayMember = 'name';

Get the displayMember property.

 const textbox = document.querySelector('smart-text-box');
 let displayMember = textbox.displayMember;

displayMode"default" | "escaped"

Specifies the visual presentation of characters within the input field, such as whether the characters are visible as plain text, masked (e.g., as password dots), or formatted in a particular style. This attribute controls how users see the inputted content while typing or reviewing their entries.

Allowed Values

  • "default" - Default behavior. Every character is as is.
  • "escaped" - Replaces the special characters with their corresponding character codes. For example, line breaks are replace with '
    '.

Default value

"default"

Example

Set the displayMode property.

 <smart-text-box display-mode='escaped'></smart-text-box>

Set the displayMode property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.displayMode = 'default';

Get the displayMode property.

 const textbox = document.querySelector('smart-text-box');
 let displayMode = textbox.displayMode;

dropDownAppendToany

Specifies the parent container to which the dropdown menu is appended in the DOM. By default, the dropdown is rendered within its original parent element. However, if an ancestor element has restricted overflow (e.g., 'overflow: hidden' or 'overflow: auto'), the dropdown may be clipped and not display correctly. To resolve this, you can set the dropDownAppendTo property to ''body'', the ID of a specific HTML element, or a direct reference to an HTML element. When set, the dropdown will be moved to the specified container in the DOM, ensuring it displays properly regardless of overflow constraints in its ancestors. To restore the dropdown to its original parent, reset this property to null.

This feature is especially useful for ensuring that dropdowns are visible and functional in complex layouts where parent elements limit visibility due to CSS overflow properties.

Example

Set the dropDownAppendTo property.

 <smart-text-box drop-down-append-to='body'></smart-text-box>

Set the dropDownAppendTo property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownAppendTo = null;

Get the dropDownAppendTo property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownAppendTo = textbox.dropDownAppendTo;

dropDownHeightstring | number

Specifies the height of the dropdown menu. By default, this property is set to an empty string, which means the dropdown's height will be determined by a CSS variable. To customize the dropdown's height directly, you can assign a specific value (e.g., "200px" or "50%") to this property. Otherwise, leaving it empty enables the component to use the height defined by the associated CSS variable.

Default value

""

Example

Set the dropDownHeight property.

 <smart-text-box drop-down-height='auto'></smart-text-box>

Set the dropDownHeight property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownHeight = 500;

Get the dropDownHeight property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownHeight = textbox.dropDownHeight;

dropDownMaxHeightstring | number

Defines the maximum height for the dropdown menu. If no value is set (default is an empty string), the dropdown’s maximum height will be determined by a corresponding CSS variable instead. This allows for dynamic styling via CSS, while still providing the option to specify a fixed maximum height directly through this property.

Default value

""

Example

Set the dropDownMaxHeight property.

 <smart-text-box drop-down-max-height='800'></smart-text-box>

Set the dropDownMaxHeight property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownMaxHeight = 1000;

Get the dropDownMaxHeight property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownMaxHeight = textbox.dropDownMaxHeight;

dropDownMaxWidthstring | number

Specifies the maximum width of the dropdown menu. By default, this property is set to an empty string, meaning that the dropdown's max-width is determined by a corresponding CSS variable. If a specific value (such as '300px' or '100%') is provided, it will override the CSS variable and directly set the maximum width of the dropdown.

Default value

""

Example

Set the dropDownMaxWidth property.

 <smart-text-box drop-down-max-width='500'></smart-text-box>

Set the dropDownMaxWidth property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownMaxWidth = 800;

Get the dropDownMaxWidth property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownMaxWidth = textbox.dropDownMaxWidth;

dropDownMinHeightstring | number

Defines the minimum height of the dropdown menu. By default, this property is set to an empty string (""), which means the minimum height is not explicitly specified in the component and will instead be determined by the value of a related CSS variable. If a specific value (such as "200px" or "2rem") is provided, it will override the CSS variable and set the minimum height of the dropdown directly.

Default value

""

Example

Set the dropDownMinHeight property.

 <smart-text-box drop-down-min-height='50'></smart-text-box>

Set the dropDownMinHeight property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownMinHeight = 150;

Get the dropDownMinHeight property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownMinHeight = textbox.dropDownMinHeight;

dropDownMinWidthstring | number

Specifies the minimum width of the dropdown menu. By default, this property is set to an empty string, which means the dropdown's minimum width is determined by a corresponding CSS variable. If you provide a specific value (such as '200px' or '20rem'), it will override the CSS variable and set the dropdown's minimum width accordingly.

Default value

""

Example

Set the dropDownMinWidth property.

 <smart-text-box drop-down-min-width='100'></smart-text-box>

Set the dropDownMinWidth property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownMinWidth = 90;

Get the dropDownMinWidth property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownMinWidth = textbox.dropDownMinWidth;

dropDownOpenMode"none" | "default" | "auto"

Specifies the direction or animation style in which the dropdown menu appears when activated (e.g., opens upwards, downwards, or with a fade effect).

Allowed Values

  • "none" - The drop down can't be opened.
  • "default" - The drop down opens when the user clicks on the element
  • "auto" - The drop down opens when the element is hovered and closes when not.

Default value

"default"

Example

Set the dropDownOpenMode property.

 <smart-text-box drop-down-open-mode='auto'></smart-text-box>

Set the dropDownOpenMode property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownOpenMode = 'default';

Get the dropDownOpenMode property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownOpenMode = textbox.dropDownOpenMode;

dropDownOverlayboolean

When this property is enabled, opening the element’s dropdown will create a transparent overlay that covers the entire area between the dropdown and the rest of the webpage. This overlay ensures that any clicks outside the dropdown are intercepted by the overlay itself, rather than interacting with underlying DOM elements. As a result, clicking outside the dropdown can be handled consistently—for example, to close the dropdown—without triggering unintended interactions elsewhere on the page.

Default value

false

Example

Set the dropDownOverlay property.

 <smart-text-box drop-down-overlay></smart-text-box>

Set the dropDownOverlay property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownOverlay = false;

Get the dropDownOverlay property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownOverlay = textbox.dropDownOverlay;

dropDownPlaceholderstring

Specifies the placeholder text that appears in the dropdown menu when there are no available items to display. This text provides guidance or context to users, indicating that the dropdown is currently empty.

Default value

"No Items"

Example

Set the dropDownPlaceholder property.

 <smart-text-box drop-down-placeholder='No Items'></smart-text-box>

Set the dropDownPlaceholder property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownPlaceholder = 'Empty';

Get the dropDownPlaceholder property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownPlaceholder = textbox.dropDownPlaceholder;

dropDownPosition"auto" | "top" | "bottom" | "overlay-top" | "overlay-center" | "overlay-bottom" | "center-bottom" | "center-top"

Specifies the alignment and placement of the dropdown menu relative to its trigger element when the dropdown is opened, allowing you to control where the menu appears on the screen (e.g., above, below, left, or right of the trigger).

Allowed Values

  • "auto" - The position is automatically determines by measuring the available distance around the element for the drop down to open freely without being clipped by the edges of the browser. By default the drop down will try to open below the element. If the available space is not enough for the drop down to appear it will open in one of the following directions, if possible: top, over.
  • "top" - The drop down opens above the element.
  • "bottom" - The drop down opens under the element.
  • "overlay-top" - The drop down opens above and over the element. The bottom edges of the drop down cover the element.
  • "overlay-center" - The drop down opens at the center, over the element.
  • "overlay-bottom" - The drop down opens under and over the element. The top edges of the drop down cover the element.
  • "center-bottom" - The drop down opens at the center, below the element.
  • "center-top" - The drop down opens at the center, over the element.

Default value

"auto"

Example

Set the dropDownPosition property.

 <smart-text-box drop-down-position='top'></smart-text-box>

Set the dropDownPosition property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownPosition = 'bottom';

Get the dropDownPosition property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownPosition = textbox.dropDownPosition;

dropDownWidthstring | number

Specifies the width of the dropdown menu. By default, this property is set to an empty string (""). When left empty, the dropdown's width is determined by a corresponding CSS variable, allowing for flexible styling through external or theme-based CSS. To explicitly set a custom width, provide a valid CSS width value (e.g., "200px", "50%").

Default value

""

Example

Set the dropDownWidth property.

 <smart-text-box drop-down-width='auto'></smart-text-box>

Set the dropDownWidth property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.dropDownWidth = 500;

Get the dropDownWidth property.

 const textbox = document.querySelector('smart-text-box');
 let dropDownWidth = textbox.dropDownWidth;

escKeyMode"none" | "previousValue" | "clearValue"

Specifies how the element responds when the Escape key is pressed, such as closing a dialog, dismissing a modal, or performing a custom action.

Allowed Values

  • "none" - Nothing happens on escape key.
  • "previousValue" - The previous value is retrieved.
  • "clearValue" - The value is cleared.

Default value

"none"

Example

Set the escKeyMode property.

 <smart-text-box esc-key-mode='contains'></smart-text-box>

Set the escKeyMode property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.escKeyMode = 'equals';

Get the escKeyMode property.

 const textbox = document.querySelector('smart-text-box');
 let escKeyMode = textbox.escKeyMode;

enterKeyBehavior"submit" | "clearOnSubmit"

Defines how the "Enter" key functions within the application, such as whether it submits a form, inserts a new line, or triggers a specific action, depending on the context.

Allowed Values

  • "submit" - Submits the value.
  • "clearOnSubmit" - Submits and clears the value.

Default value

"submit"

Example

Set the enterKeyBehavior property.

 <smart-text-box enter-key-behavior='newLine'></smart-text-box>

Set the enterKeyBehavior property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.enterKeyBehavior = 'submit';

Get the enterKeyBehavior property.

 const textbox = document.querySelector('smart-text-box');
 let enterKeyBehavior = textbox.enterKeyBehavior;

formstring

Specifies the form element with which this element is associated, known as its "form owner." The value of this attribute must be the ID of a element present in the same document. This allows the element to be associated with a specific form, even if it is not nested directly within the form’s markup.

Default value

""

Example

Set the form property.

 <smart-text-box form='form1'></smart-text-box>

Set the form property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.form = 'form2';

Get the form property.

 const textbox = document.querySelector('smart-text-box');
 let form = textbox.form;

hintany

Provides supplemental helper text displayed beneath the element. This hint appears exclusively when the element is focused, offering contextual guidance to the user during interaction.

Example

Set the hint property.

 <smart-text-box hint='Helper text'></smart-text-box>

Set the hint property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.hint = Hint;

Get the hint property.

 const textbox = document.querySelector('smart-text-box');
 let hint = textbox.hint;

horizontalScrollBarVisibility"auto" | "disabled" | "hidden" | "visible"

Controls whether the horizontal scroll bar within the dropdown menu is visible. This setting allows you to enable or disable horizontal scrolling for dropdown content that extends beyond the visible area.

Allowed Values

  • "auto" - The element automatically determines whether or not the horizontal Scroll bar should be visible or not.
  • "disabled" - Disables the horizontal Scroll bar.
  • "hidden" - Hides the horizontal Scroll bar.
  • "visible" - Shows the horizontal Scroll bar even if not necessary.

Default value

"auto"

Example

Set the horizontalScrollBarVisibility property.

 <smart-text-box horizontal-scroll-bar-visibility='disabled'></smart-text-box>

Set the horizontalScrollBarVisibility property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.horizontalScrollBarVisibility = 'hidden';

Get the horizontalScrollBarVisibility property.

 const textbox = document.querySelector('smart-text-box');
 let horizontalScrollBarVisibility = textbox.horizontalScrollBarVisibility;

inputMemberstring

Represents the property key of a List item's object that specifies which value should be displayed in the input field when a ListItem is selected. This property is useful when you want to show a value other than the default label—such as a unique identifier or another attribute—within the input. By default, the item's label is shown. Use this option to customize the displayed value based on a different property from your data objects.

Default value

""

Example

Set the inputMember property.

 <smart-text-box input-member='label'></smart-text-box>

Set the inputMember property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.inputMember = 'value';

Get the inputMember property.

 const textbox = document.querySelector('smart-text-box');
 let inputMember = textbox.inputMember;

inputPurposestring

Defines the purpose of the input field and specifies the type of data expected, providing guidance to browsers and user agents for offering autofill suggestions. This property maps directly to the standard HTML autocomplete attribute, allowing developers to control whether and how a browser can automatically fill in the field based on the user's stored information. Possible values include generic options like 'on' and 'off', as well as more specific data types such as 'name', 'organization', 'email', 'street-address', and others, enabling enhanced user experience and data accuracy in forms.

Default value

"off"

Example

Set the inputPurpose property.

 <smart-text-box input-purpose='on'></smart-text-box>

Set the inputPurpose property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.inputPurpose = 'country';

Get the inputPurpose property.

 const textbox = document.querySelector('smart-text-box');
 let inputPurpose = textbox.inputPurpose;

itemHeightnumber | null

Specifies the height (in pixels) for each list item when rendering the list.
This property is only applicable if list virtualization is enabled, as it allows the component to accurately calculate and display only the visible items for improved performance.

Example

Set the itemHeight property.

 <smart-text-box item-height='20'></smart-text-box>

Set the itemHeight property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.itemHeight = 30;

Get the itemHeight property.

 const textbox = document.querySelector('smart-text-box');
 let itemHeight = textbox.itemHeight;

itemMeasureMode"auto" | "precise"

Specifies the algorithm used to calculate the width of each item, determining how item widths are measured and displayed within the layout. This setting influences whether widths are fixed, dynamic, or adapt based on content or container size.

Allowed Values

  • "auto" - measures items based on the number of characters in their label
  • "precise" - measures items based on their actual size in the DOM; may hinder performance for large data sources

Default value

"auto"

Example

Set the itemMeasureMode property.

 <smart-text-box item-measure-mode='precise'></smart-text-box>

Set the itemMeasureMode property by using the HTML Element's instance.

 const textbox = document.querySelector('smart-text-box');
 textbox.itemMeasureMode = 'auto';

Get the itemMeasureMode property.

 const textbox = document.querySelector('smart-text-box');
 let itemMeasureMode = textbox.itemMeasureMode;

items{label: string, value: any}[]

A getter that retrieves and returns an array containing all the list item elements (e.g., '

  • ' elements) currently present within the dropdown menu. This allows easy access to all items displayed in the dropdown for further manipulation or inspection.

    Default value

    ""

    itemTemplateany

    The itemTemplate property is a string specifying the id of an HTMLTemplateElement present in the DOM. This template is used to define and customize the structure and content of each item rendered within the list. By referencing the id of an HTMLTemplateElement, you can control how individual list items are displayed, allowing for flexible and reusable item layouts.

    Example

    Set the itemTemplate property.

     <smart-text-box item-template=''templateA''></smart-text-box>

    Set the itemTemplate property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.itemTemplate = 'templateB';

    Get the itemTemplate property.

     const textbox = document.querySelector('smart-text-box');
     let itemTemplate = textbox.itemTemplate;

    labelstring

    Displays a small text label positioned above the element, typically used to provide additional context or information about the element’s purpose.

    Default value

    ""

    Example

    Set the label property.

     <smart-text-box label='Helper text'></smart-text-box>

    Set the label property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.label = 'Label';

    Get the label property.

     const textbox = document.querySelector('smart-text-box');
     let label = textbox.label;

    loadingIndicatorPlaceholderstring

    Specifies the text that appears alongside the loading indicator when the loader is visible and positioned at either the top or bottom of the container. This text provides context or status information to users while the loading process is ongoing.

    Default value

    "Loading..."

    Example

    Set the loadingIndicatorPlaceholder property.

     <smart-text-box loading-indicator-placeholder='Incoming data'></smart-text-box>

    Set the loadingIndicatorPlaceholder property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.loadingIndicatorPlaceholder = 'LOADING...';

    Get the loadingIndicatorPlaceholder property.

     const textbox = document.querySelector('smart-text-box');
     let loadingIndicatorPlaceholder = textbox.loadingIndicatorPlaceholder;

    loadingIndicatorPosition"bottom" | "center" | "top"

    Specifies the screen location where the loading indicator will be displayed (e.g., top, bottom, center, etc.), allowing developers to control the visual placement of the loading element within the application's interface.

    Allowed Values

    • "bottom" - Positions the loading indicator at the bottom of the list.
    • "center" - Positions the loading indicator at the center of the list.
    • "top" - Positions the loading indicator at the bottom of the list.

    Default value

    "center"

    Example

    Set the loadingIndicatorPosition property.

     <smart-text-box loading-indicator-position='bottom'></smart-text-box>

    Set the loadingIndicatorPosition property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.loadingIndicatorPosition = 'top';

    Get the loadingIndicatorPosition property.

     const textbox = document.querySelector('smart-text-box');
     let loadingIndicatorPosition = textbox.loadingIndicatorPosition;

    unlockKeystring

    Defines or retrieves the unlockKey, a unique code or token used to grant access to the product's features or functionality.

    Default value

    ""

    Example

    Set the unlockKey property.

     <smart-text-box unlock-key=''></smart-text-box>

    Set the unlockKey property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.unlockKey = '1111-2222-3333-4444-5555';

    Get the unlockKey property.

     const textbox = document.querySelector('smart-text-box');
     let unlockKey = textbox.unlockKey;

    localestring

    Sets or retrieves the current language for localization purposes. This property is used together with the messages property, which contains language-specific content or translations. Adjusting the language will determine which set of messages is displayed or utilized within the application.

    Default value

    "en"

    Example

    Set the locale property.

     <smart-text-box locale='de'></smart-text-box>

    Set the locale property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.locale = 'en';

    Get the locale property.

     const textbox = document.querySelector('smart-text-box');
     let locale = textbox.locale;

    localizeFormatFunctionfunction | null

    A callback function that allows you to define a custom format for messages returned by the Localization Module. This enables you to modify or enhance the localized messages—such as adding prefixes, changing text structure, or injecting dynamic values—before they are displayed to the user.

    Example

    Set the localizeFormatFunction property.

     <smart-text-box localize-format-function='function(defaultMessage, message, messageArguments){return '...'}'></smart-text-box>

    Set the localizeFormatFunction property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.localizeFormatFunction = function(defaultMessage, message, messageArguments){return '...'};

    Get the localizeFormatFunction property.

     const textbox = document.querySelector('smart-text-box');
     let localizeFormatFunction = textbox.localizeFormatFunction;

    maxLengthnumber

    Specifies or retrieves the maximum number of characters allowed for user input in a text field. This limits how many characters a user can type or paste into the field.

    Example

    Set the maxLength property.

     <smart-text-box max-length='120'></smart-text-box>

    Set the maxLength property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.maxLength = 150;

    Get the maxLength property.

     const textbox = document.querySelector('smart-text-box');
     let maxLength = textbox.maxLength;

    minLengthnumber

    Specifies or retrieves the minimum number of characters a user must type before the auto-complete feature is activated and suggestions are displayed.

    Default value

    2

    Example

    Set the minLength property.

     <smart-text-box min-length='1'></smart-text-box>

    Set the minLength property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.minLength = 3;

    Get the minLength property.

     const textbox = document.querySelector('smart-text-box');
     let minLength = textbox.minLength;

    messagesobject

    Defines or retrieves an object containing the set of strings (such as labels, tooltips, button text, and messages) used throughout the widget interface, allowing these strings to be localized for different languages. This property works together with the language property to ensure the widget’s text content is displayed in the appropriate language for users.

    Default value




    "en": {

    "propertyUnknownType": "'{{name}}' property is with undefined 'type' member!",

    "propertyInvalidValue": "Invalid '{{name}}' property value! Actual value: {{actualValue}}, Expected value: {{value}}!",

    "propertyInvalidValueType": "Invalid '{{name}}' property value type! Actual type: {{actualType}}, Expected type: {{type}}!",

    "elementNotInDOM": "Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",

    "moduleUndefined": "Module is undefined.",

    "missingReference": "{{elementType}}: Missing reference to {{files}}.",

    "htmlTemplateNotSuported": "{{elementType}}: Browser doesn't support HTMLTemplate elements.",

    "invalidTemplate": "{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM.",

    "invalidNode": "{{elementType}}: Invalid parameter '{{node}}' when calling {{method}}."

    }

    Example

    Set the messages property.

     <smart-text-box messages='{"de":{"propertyUnknownType":"Die Eigenschaft '{{name}}' hat ein nicht definiertes 'type'-Member!","propertyInvalidValue":"Ungultiger Eigenschaftswert '{{name}}'! Aktueller Wert: {{actualValue}}, Erwarteter Wert: {{value}}!","propertyInvalidValueType":"Ungultiger Eigenschaftswert '{{name}}'! Aktueller Wert: {{actualType}}, Erwarteter Wert: {{type}}!","elementNotInDOM":"Element existiert nicht in DOM! Bitte fugen Sie das Element zum DOM hinzu, bevor Sie eine Methode aufrufen.","moduleUndefined":"Modul ist nicht definiert.","missingReference":"{{elementType}}: Fehlender Verweis auf {{files}}.","htmlTemplateNotSuported":"{{elementType}}: Browser unterstutzt keine HTMLTemplate-Elemente.","invalidTemplate":"{{elementType}}: '{{property}}' Die Eigenschaft akzeptiert eine Zeichenfolge, die mit der ID eines HTMLTemplate-Elements aus dem DOM ubereinstimmen muss.","invalidNode":"{{elementType}}: Ungultiger Parameter '{{node}}' beim Aufruf von {{method}}."}}'></smart-text-box>

    Set the messages property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.messages = {"en":{"propertyUnknownType":"'{{name}}' property is with undefined 'type' member!","propertyInvalidValue":"Invalid '{{name}}' property value! Actual value: {{actualValue}}, Expected value: {{value}}!","propertyInvalidValueType":"Invalid '{{name}}' property value type! Actual type: {{actualType}}, Expected type: {{type}}!","elementNotInDOM":"Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.","moduleUndefined":"Module is undefined.","missingReference":"{{elementType}}: Missing reference to {{files}}.","htmlTemplateNotSuported":"{{elementType}}: Browser doesn't support HTMLTemplate elements.","invalidTemplate":"{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM.","invalidNode":"{{elementType}}: Invalid parameter '{{node}}' when calling {{method}}."}};

    Get the messages property.

     const textbox = document.querySelector('smart-text-box');
     let messages = textbox.messages;

    namestring

    Sets or retrieves the name attribute of the element. The name attribute specifies a key associated with the element's value when submitting HTML forms, enabling server-side identification and processing of submitted data. This is essential for form controls such as inputs, selects, and textareas.

    Default value

    ""

    Example

    Set the name property.

     <smart-text-box name='combobox'></smart-text-box>

    Set the name property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.name = 'comboBox2';

    Get the name property.

     const textbox = document.querySelector('smart-text-box');
     let name = textbox.name;

    openedboolean

    Indicates whether the dropdown menu is currently expanded (open) and visible to the user, or collapsed (closed) and hidden from view.

    Default value

    false

    Example

    Set the opened property.

     <smart-text-box opened></smart-text-box>

    Set the opened property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.opened = false;

    Get the opened property.

     const textbox = document.querySelector('smart-text-box');
     let opened = textbox.opened;

    placeholderstring

    Specifies the placeholder text that appears inside the input field when it is empty, providing guidance or an example of the expected input to the user.

    Default value

    ""

    Example

    Set the placeholder property.

     <smart-text-box placeholder='Choose:'></smart-text-box>

    Set the placeholder property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.placeholder = 'Submit';

    Get the placeholder property.

     const textbox = document.querySelector('smart-text-box');
     let placeholder = textbox.placeholder;

    readonlyboolean

    Prevents any user interaction with the element, disabling actions such as clicking, focusing, hovering, or keyboard input. The element will not respond to any user events while this setting is applied.

    Default value

    false

    Example

    Set the readonly property.

     <smart-text-box readonly></smart-text-box>

    Set the readonly property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.readonly = false;

    Get the readonly property.

     const textbox = document.querySelector('smart-text-box');
     let readonly = textbox.readonly;

    rightToLeftboolean

    Sets or retrieves a value that specifies whether the element’s content is aligned for right-to-left (RTL) text direction, supporting languages and locales such as Arabic or Hebrew. When enabled, the element’s layout and text flow will be adjusted to display content appropriately for RTL reading order.

    Default value

    false

    Example

    Set the rightToLeft property.

     <smart-text-box right-to-left></smart-text-box>

    Set the rightToLeft property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.rightToLeft = true;

    Get the rightToLeft property.

     const textbox = document.querySelector('smart-text-box');
     let rightToLeft = textbox.rightToLeft;

    requiredboolean

    Indicates that the input field is required, meaning the user must provide a value in this field before the form can be submitted successfully. If the input is left empty, the form submission will be blocked and the user will be prompted to complete the required information.

    Default value

    false

    Example

    Set the required property.

     <smart-text-box required></smart-text-box>

    Set the required property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.required = false;

    Get the required property.

     const textbox = document.querySelector('smart-text-box');
     let required = textbox.required;

    requiredMessagestring

    Defines the custom error message displayed to users when the input is marked as required but no value has been entered. If the required field is left empty, this message will be shown to prompt the user to provide the necessary input.

    Default value

    ""

    Example

    Set the requiredMessage property.

     <smart-text-box required-message='Required'></smart-text-box>

    Set the requiredMessage property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.requiredMessage = 'Mandatory';

    Get the requiredMessage property.

     const textbox = document.querySelector('smart-text-box');
     let requiredMessage = textbox.requiredMessage;

    selectAllOnFocusboolean

    Specifies whether the entire content of the input field should automatically be highlighted (selected) when the input receives focus, allowing users to easily replace or copy the content.

    Default value

    false

    Example

    Set the selectAllOnFocus property.

     <smart-text-box select-all-on-focus></smart-text-box>

    Set the selectAllOnFocus property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.selectAllOnFocus = false;

    Get the selectAllOnFocus property.

     const textbox = document.querySelector('smart-text-box');
     let selectAllOnFocus = textbox.selectAllOnFocus;

    themestring

    Specifies the theme to be applied, which controls the overall appearance and visual style of the element, including colors, fonts, and other stylistic details.

    Default value

    ""

    Example

    Set the theme property.

     <smart-text-box theme='blue'></smart-text-box>

    Set the theme property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.theme = 'red';

    Get the theme property.

     const textbox = document.querySelector('smart-text-box');
     let theme = textbox.theme;

    unfocusableboolean

    If set to true, the element will be excluded from the tab order and cannot receive keyboard or programmatic focus. This means users will not be able to navigate to the element using the Tab key or set focus to it via scripts.

    Default value

    false

    Example

    Set the unfocusable property.

     <smart-text-box unfocusable></smart-text-box>

    Set the unfocusable property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.unfocusable = false;

    Get the unfocusable property.

     const textbox = document.querySelector('smart-text-box');
     let unfocusable = textbox.unfocusable;

    valuestring

    Sets a new value for the element or retrieves its current value, depending on how the method is used. Useful for reading or updating the content, input, or state of form elements such as text fields, checkboxes, or select menus.

    Default value

    ""

    Example

    Set the value property.

     <smart-text-box value='Demo value.'></smart-text-box>

    Set the value property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.value = 'New demo value.';

    Get the value property.

     const textbox = document.querySelector('smart-text-box');
     let value = textbox.value;

    valueMemberstring



    Specifies which property of each item object represents its value. The valueMember setting is particularly useful when binding the ListBox to data from a JSON file as its dataSource and you need to designate a specific property in the JSON objects to be used as the item's value. This is similar to how groupMember works, but instead of grouping items, valueMember tells the ListBox which property to use for the underlying value of each list item. For example, if your JSON objects have an "id" property, setting valueMember to "id" will store the value of the "id" property for each item in the ListBox.

    Default value

    """"

    Example

    Set the valueMember property.

     <smart-text-box value-member='value'></smart-text-box>

    Set the valueMember property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.valueMember = 'newValue';

    Get the valueMember property.

     const textbox = document.querySelector('smart-text-box');
     let valueMember = textbox.valueMember;

    verticalScrollBarVisibility"auto" | "disabled" | "hidden" | "visible"

    Controls whether the vertical scroll bar within the dropdown menu is visible. This property allows you to specify if users can scroll vertically to view additional dropdown options when the content overflows the visible area.

    Allowed Values

    • "auto" - The element automatically determines whether or not the horizontal scroll bar should be visible or not.
    • "disabled" - Disables the horizontal scroll bar.
    • "hidden" - Hides the horizontal scroll bar.
    • "visible" - Shows the horizontal scroll bar even if not necessary.

    Default value

    "auto"

    Example

    Set the verticalScrollBarVisibility property.

     <smart-text-box vertical-scroll-bar-visibility='hidden'></smart-text-box>

    Set the verticalScrollBarVisibility property by using the HTML Element's instance.

     const textbox = document.querySelector('smart-text-box');
     textbox.verticalScrollBarVisibility = 'visible';

    Get the verticalScrollBarVisibility property.

     const textbox = document.querySelector('smart-text-box');
     let verticalScrollBarVisibility = textbox.verticalScrollBarVisibility;

    Events

    changeCustomEvent

    This event is triggered whenever the value in the Text Box changes and is confirmed by the user. Specifically, it fires under two conditions:
    1. When the user moves focus away from the Text Box (on blur).
    2. When the user presses the 'Enter' key while the Text Box is focused.

    This ensures that the event only occurs after the user has finished editing the text, rather than on every keystroke.

    • Bubbles Yes
    • Cancelable No
    • Interface CustomEvent
    • Event handler property onChange

    Arguments

    evCustomEvent
    ev.detailObject
    ev.detail.oldValue - The previous value before it was changed.
    ev.detail.value - The new value.
    ev.detail.type - The type of the event.

    Methods

    isDefaultPrevented

    Returns true if the event was prevented by any of its subscribers.

    Returns

    boolean true if the default action was prevented. Otherwise, returns false.

    preventDefault

    The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

    stopPropagation

    The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

    Example

    Set up the event handler of change event.

    const textbox = document.querySelector('smart-text-box');
    textbox.addEventListener('change', function (event) {
        const detail = event.detail,
            oldValue = detail.oldValue,
            value = detail.value,
            type = detail.type;
    
    	// event handling code goes here.
    })
    

    changingCustomEvent

    This event is triggered each time a user releases a key (on the keyup event) within the TextBox, but only if the content of the TextBox has changed since the previous event.

    • Bubbles Yes
    • Cancelable Yes
    • Interface CustomEvent
    • Event handler property onChanging

    Arguments

    evCustomEvent
    ev.detailObject
    ev.detail.oldValue - The previous value before it was changed.
    ev.detail.value - The new value.

    Methods

    isDefaultPrevented

    Returns true if the event was prevented by any of its subscribers.

    Returns

    boolean true if the default action was prevented. Otherwise, returns false.

    preventDefault

    The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

    stopPropagation

    The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

    Example

    Set up the event handler of changing event.

    const textbox = document.querySelector('smart-text-box');
    textbox.addEventListener('changing', function (event) {
        const detail = event.detail,
            oldValue = detail.oldValue,
            value = detail.value;
    
    	// event handling code goes here.
    })
    

    Methods

    close(): void

    Closes the drop-down menu associated with the input field. Note: The drop-down appears only when auto-complete functionality is enabled, allowing users to select from suggested options.


    Invoke the close method.

    const textbox = document.querySelector('smart-text-box');
    textbox.close();

    open(): void

    Expands the drop-down menu, allowing users to view and select available options. This drop-down menu is displayed exclusively when the autocomplete feature is enabled, providing relevant suggestions based on user input.


    Invoke the open method.

    const textbox = document.querySelector('smart-text-box');
    textbox.open();

    reset(): void

    This method resets the input field to its original, initial value, effectively clearing any changes made by the user and restoring the input to its default state as set when the component or page first loaded.


    Invoke the reset method.

    const textbox = document.querySelector('smart-text-box');
    textbox.reset();

    CSS Variables

    --smart-text-box-default-widthvar()

    Default value

    "var(--smart-editor-width)"

    Text Box default width.

    --smart-text-box-default-heightvar()

    Default value

    "var(--smart-editor-height)"

    Text Box default height.


  • ListItem

    Defines a list item for ListBox, ComboBox, DropDownList.

    Selector

    smart-list-item

    Properties

    AalternationIndexalternationIndex
    Ccolorcolor
    DdisplayModedisplayMode
    Ggroupedgrouped
    Sselectedselected
    Vvaluevalue
    Llabellabel
    Ddetailsdetails
    Ggroupgroup
    Hhiddenhidden
    Rreadonlyreadonly

    Properties

    alternationIndexnumber

    Default value

    -1

    colorstring

    Default value

    ""

    displayMode"plain" | "checkBox" | "radioButton"

    Default value

    "plain"

    groupedboolean

    Default value

    false
     <smart-list-item grouped></smart-list-item>

    selectedboolean

    Default value

    false
     <smart-list-item selected></smart-list-item>

    valuestring

    Default value

    ""

    labelstring

    Default value

    ""

    detailsstring

    Default value

    ""

    groupstring

    Default value

    ""

    hiddenboolean

    Default value

    false
     <smart-list-item hidden></smart-list-item>

    readonlyboolean

    Default value

    false
     <smart-list-item readonly></smart-list-item>


    ListItemsGroup

    Defines a group of list items.

    Selector

    smart-list-items-group

    Properties

    Llabellabel

    Properties

    labelstring

    Default value

    ""