Skip to content

Material Single Select

This field type is designed for handling dropdown elements in web applications, particularly focusing on search and selection functionalities. The options provided allow for fine-tuning the behavior of the dropdown interaction, ensuring accurate and efficient selection of options.

img

Options

OptionsDescription
Match options asHow the field value should be matched with the dropdown options.
External Library NameIf you know that an external library is used in the dropdown then select that library. If the library name is not there then select Other Material Library option.
Want until max options in the dropdown elementWait until the maximum number of options are available in the dropdown before proceeding.
Convert the text into lowercase letters and then match the textConvert the text to lowercase before matching it with the dropdown options.
Remove extra space from option text then match the textRemove any extra spaces from the option text before matching.
Remove all space from option text then match the textRemove all spaces from the option text before matching.
Waiting time after dropdown is openSets the waiting time (in milliseconds) after the dropdown is opened before any action is taken.
If this field is to select text after the searchIndicates whether the field is used to select text after performing a search within the dropdown.
Before selecting the dropdown option, check that option is already selected?Specifies whether the field should check if the option is already selected before attempting to select it again.
Before selecting the dropdown option, uncheck the already selected optionsDetermines whether the field should uncheck any already selected options before selecting the new one.
Trigger event on dropdown matched optionSpecifies whether an event should be triggered when the matched option is found in the dropdown.

Match options as

This option gives the matching options available to select text based on various criteria.

OptionsDescriptionExample
Equal to NameSelect an option that exactly matches the provided field value.Select the option only if it matches the field value exactly.
Search Name in Any PositionSearch for the provided field value at any position within the option text.Select the option if the field value appears anywhere in the option text.
Match Name from Start-End PositionField value to match the option text entirely, from start to end.Select the option only if the field value matches the entire option text from start to end.

External Library Name

Specifies the name of the external library used for handling dropdown interactions. If the library name is not there then select Other Material Library option.

Other Material Library

If you select the Other Material Library option, you'll need to define the following values, with Dropdown Options List Query being essential:

OptionsDescription
Dropdown Options List QuerySpecifies the query selector for the elements that represent the selection options within the dropdown.
Dropdown Open Element QueryDefines the query selector for the element that triggers the opening of the dropdown.
Dropdown Close Element QuerySpecifies the query selector for the element that triggers the closing of the dropdown.
Selected Value Element QuerySpecifies the query selector for the element that displays the currently selected value.

Other Material Libraries

MUI Autocomplete

Dropdown options list selector query is ul > li.MuiAutocomplete-option for MUI Autocomplete.

MUI Select
  • How to open MUI Select dropdown options.
    js
    let event = new MouseEvent("mousedown", {
      view: window,
      bubbles: true,
      cancelable: true,
    });
    document.querySelector("input").parentNode.querySelector("div").dispatchEvent(event);
  • Dropdown options list selector query is ul.MuiMenu-list > li[role="option"]
    js
    // For choice dropdown option
    document.querySelector("div.MuiSelect-select").dispatchEvent(new MouseEvent("mousedown", { bubbles: true }));
  • Close already opened options selector query div.MuiModal-root[role='presentation'] > div
React Select

Dropdown options list selector query is div[class*='-menu'] div[class*='-option'] for React Select.

  • Use field javascript event ['mousedown', 'click', 'mouseup'] for open dropdown options and this is selector query div[class*='-indicatorContainer']
Chosen Dropdown

Use field javascript mouse event ['mouseup'] for Chosen Dropdown.

NOTE

If you are using a kendo-ui dropdown, do not use the field's javascript event option.

Supported Libraries

Released under the MIT License.