Form elements (basics) - Dropdown (single select)
See original GitHub issue"Dropdown": {
"methods": {
"open": {
"desc": "Opens the menu"
},
"addOption": {
"desc": "Adds an option to the menu",
"params": [
"{Option} option - an instance of the Option partial",
"{Option} [referenceOption] - (Optional) a reference option used when positioning the new option. New option will be added before the reference option."
]
},
"close": {
"desc": "Closes the menu"
},
"disable": {
"desc": "Disables the option, preventing it from being selected"
},
"enable": {
"desc": "Enables the option, allowing it to be selected"
},
"onBlur": {
"desc": "Calls the provided callback when focus moves away from the dropdown",
"params": "HIG.abstract.EventObject.params",
"returns": "HIG.abstract.EventObject.returns"
},
"onClickOutside": {
"desc": "Calls the provided callback when the menu is open and the user clicks outside of the menu",
"params": "HIG.abstract.EventObject.params",
"returns": "HIG.abstract.EventObject.returns"
},
"onFocus": {
"desc": "Calls the provided callback when the dropdown gains focus",
"params": "HIG.abstract.EventObject.params",
"returns": "HIG.abstract.EventObject.returns"
},
"onKeypress": {
"desc": "Calls the provided callback when the user presses a key while the dropdown has focus",
"params": "HIG.abstract.EventObject.params",
"returns": "HIG.abstract.EventObject.returns"
},
"onTargetClick": {
"desc": "Calls the provided callback when the user clicks on the dropdown button",
"params": "HIG.abstract.EventObject.params",
"returns": "HIG.abstract.EventObject.returns"
},
"required": {
"desc": "makes field required",
"params": [
"{String} required label text"
]
},
"noLongerRequired": {
"desc": "makes field not required"
},
"setInstructions": {
"desc": "Sets instructional text for the dropdown",
"params": [
"{String} instructions - instrucitonal text that wil appear below the dropdown"
]
},
"setLabel": {
"desc": "Sets the label for the dropdown",
"params": [
"{String} label - label identifying the purpose of the dropdown"
]
},
"setSelectedOptionLabel": {
"desc": "Sets the label on the dropdown button, representing the label of the selected option"
}
},
"partials": {
"Option": {
"methods": {
"deselect": {},
"onHover": {},
"onClick": {},
"select": {},
"setLabel": {},
"setValue": {}
},
"defaults": {
"label": "",
"value": null
}
}
},
"defaults": {
"label": "",
"instructions": ""
}
},
Todo:
- Style
- Enable configuring with defaults
- Enable configuring with setters
- Add test/playground page
- Add Gemini test
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
HTML Form Elements - W3Schools
The <option> elements defines an option that can be selected. By default, the first item in the drop-down list is selected. To define...
Read more ><select>: The HTML Select element - HTML - MDN Web Docs
The <select> element has some unique attributes you can use to control it, such as multiple to specify whether multiple options can be...
Read more >HTML Select Tag – How to Make a Dropdown Menu or ...
The select tag normally goes within a form element, with the items to choose from coded within another tag, <option> .
Read more >How do we use a simple drop-down list of items in HTML forms?
With HTML, you can create a simple drop-down list of items to get user input in HTML forms. A select box also called...
Read more >HTML form - drop-down list - YouTube
In this video tutorial you learn about drop-down list form element. I talk about options, their label , values and attibutes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks good.
This shot shows the font that looks to be regular weight, but should be the same weight: Medium