{"record":{"id":"773d4ade2d0e414c","repo":"Semantic-Org/Semantic-UI","slug":"once-a-select-has-been-initialized-behaviors-must","errorCode":null,"errorMessage":"Once a select has been initialized behaviors must be called on the created ui dropdown","messagePattern":"Once a select has been initialized behaviors must be called on the created ui dropdown","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/definitions/modules/dropdown.js","lineNumber":3794,"sourceCode":"  onNoResults   : function(searchTerm) { return true; },\n  onShow        : function(){},\n  onHide        : function(){},\n\n  /* Component */\n  name           : 'Dropdown',\n  namespace      : 'dropdown',\n\n  message: {\n    addResult     : 'Add <b>{term}</b>',\n    count         : '{count} selected',\n    maxSelections : 'Max {maxCount} selections',\n    noResults     : 'No results found.',\n    serverError   : 'There was an error contacting the server'\n  },\n\n  error : {\n    action          : 'You called a dropdown action that was not defined',\n    alreadySetup    : 'Once a select has been initialized behaviors must be called on the created ui dropdown',\n    labels          : 'Allowing user additions currently requires the use of labels.',\n    missingMultiple : '<select> requires multiple property to be set to correctly preserve multiple values',\n    method          : 'The method you called is not defined.',\n    noAPI           : 'The API module is required to load resources remotely',\n    noStorage       : 'Saving remote data requires session storage',\n    noTransition    : 'This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>'\n  },\n\n  regExp : {\n    escape   : /[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\n    quote    : /\"/g\n  },\n\n  metadata : {\n    defaultText     : 'defaultText',\n    defaultValue    : 'defaultValue',\n    placeholderText : 'placeholder',\n    text            : 'text',","sourceCodeStart":3776,"sourceCodeEnd":3812,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/modules/dropdown.js#L3776-L3812","documentation":"This message is registered in settings.error but is never actually invoked by module.error() in the current code. The related is.alreadySetup() check (line 96 / 3150) detects when behaviors are called on a raw <select> that already has a parent dropdown and gracefully redirects via setup.reference() instead of erroring. Semantically it warns: once a <select> is initialized, call behaviors on the generated .ui.dropdown, not on the <select>.","triggerScenarios":"Not actually logged at runtime. The condition it documents: calling .dropdown('behavior') directly on a <select> whose parent .ui.dropdown already has a stored module instance — the module auto-redirects instead.","commonSituations":"Calling $('select').dropdown('set selected', x) after the dropdown was built from that select; in practice harmless because internals redirect to the parent.","solutions":["Target the generated dropdown rather than the raw select: $('select').parent('.ui.dropdown').dropdown('set selected', x)","No action needed — the module auto-redirects; treat as informational"],"exampleFix":"// before\n$('select').dropdown('set selected', 'a');\n// after\n$('select').parent('.ui.dropdown').dropdown('set selected', 'a');","handlingStrategy":"validation","validationCode":"// Target the generated dropdown, not the raw <select>, once initialized.\nfunction dropdownTarget($select) {\n  var $parent = $select.parent('.ui.dropdown');\n  return ($parent.length && $parent.data('module-dropdown')) ? $parent : $select;\n}\ndropdownTarget($('select')).dropdown('set selected', 'a');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After init, store a reference to the generated .ui.dropdown and call behaviors on it","Because this error is never actually thrown, rely on targeting the parent dropdown to avoid ambiguous state"],"tags":["dropdown","semantic-ui","select","dead-code"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}