javascript - Semantic ui dropdown menu not working in react? -
i've learning semantic-ui , works smoothly react until dropdown menu. here's code:
render() { return (<div classname="ui form"> <div classname="field"> <div classname="ui selection dropdown"> <input type="hidden" name="options"/> <i classname="dropdown icon"></i> <div classname="default text">options</div> <div classname="menu"> <div classname="item">option 1</div> <div classname="item">option 2</div> </div> </div> </div> </div>); }
i'm not using css nor libraries except react , semantic-ui, shows dropdown menu can't clicked, idea it?
from semantic ui docs :
any select element initialized dropdown hidden until javascript can create html, avoid flash of unstyled content, , change in element height adjusting page flow.
you must add following javascript in order make dropdown work
$('.ui.dropdown').dropdown();
Comments
Post a Comment