question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Form elements (basics) - Dropdown (single select)

See original GitHub issue

dropdown-2

"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:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
holsen123commented, Aug 17, 2017

Looks good.

1reaction
holsen123commented, Aug 16, 2017

This shot shows the font that looks to be regular weight, but should be the same weight: Medium

dropdown-font-weight-screenshot

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found