Semantic-Org/Semantic-UI · info

Once a select has been initialized behaviors must be called

Error message

Once a select has been initialized behaviors must be called on the created ui dropdown

What it means

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

Source

Thrown at src/definitions/modules/dropdown.js:3794

  onNoResults   : function(searchTerm) { return true; },
  onShow        : function(){},
  onHide        : function(){},

  /* Component */
  name           : 'Dropdown',
  namespace      : 'dropdown',

  message: {
    addResult     : 'Add <b>{term}</b>',
    count         : '{count} selected',
    maxSelections : 'Max {maxCount} selections',
    noResults     : 'No results found.',
    serverError   : 'There was an error contacting the server'
  },

  error : {
    action          : 'You called a dropdown action that was not defined',
    alreadySetup    : 'Once a select has been initialized behaviors must be called on the created ui dropdown',
    labels          : 'Allowing user additions currently requires the use of labels.',
    missingMultiple : '<select> requires multiple property to be set to correctly preserve multiple values',
    method          : 'The method you called is not defined.',
    noAPI           : 'The API module is required to load resources remotely',
    noStorage       : 'Saving remote data requires session storage',
    noTransition    : 'This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>'
  },

  regExp : {
    escape   : /[-[\]{}()*+?.,\\^$|#\s]/g,
    quote    : /"/g
  },

  metadata : {
    defaultText     : 'defaultText',
    defaultValue    : 'defaultValue',
    placeholderText : 'placeholder',
    text            : 'text',

View on GitHub (pinned to 597843ab84)

Solutions

  1. Target the generated dropdown rather than the raw select: $('select').parent('.ui.dropdown').dropdown('set selected', x)
  2. No action needed — the module auto-redirects; treat as informational

Example fix

// before
$('select').dropdown('set selected', 'a');
// after
$('select').parent('.ui.dropdown').dropdown('set selected', 'a');
Defensive patterns

Strategy: validation

Validate before calling

// Target the generated dropdown, not the raw <select>, once initialized.
function dropdownTarget($select) {
  var $parent = $select.parent('.ui.dropdown');
  return ($parent.length && $parent.data('module-dropdown')) ? $parent : $select;
}
dropdownTarget($('select')).dropdown('set selected', 'a');

Prevention

When it happens

Trigger: 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.

Common situations: Calling $('select').dropdown('set selected', x) after the dropdown was built from that select; in practice harmless because internals redirect to the parent.

Related errors


AI-assisted analysis of Semantic-Org/Semantic-UI@597843ab84 (2026-08-13). Data as JSON: /api/errors/773d4ade2d0e414c. Report an issue: GitHub.