Semantic-UI icon indicating copy to clipboard operation
Semantic-UI copied to clipboard

Dropdown not validating on blur or change events

Open KlustoR opened this issue 11 years ago • 8 comments

I dont know if this is for a particular reason, but i cant seem to get a dropdown box to validate on blur or change events. It does validate correctly upon form submit. All semantic-ui demo code for form validation also has this, so no demo code needed i suppose.

KlustoR avatar Feb 12 '15 05:02 KlustoR

Any update on the issue ? Here is a jsfiddle that duplicates the error : http://jsfiddle.net/8wm6uoth/18/ All elements validate trough blur, only dropdown doesn't, still validates on submit tho.

KlustoR avatar Feb 17 '15 18:02 KlustoR

I'll try to sneak this in 1.9

jlukic avatar Feb 17 '15 18:02 jlukic

awesome, thanks :+1:

KlustoR avatar Feb 17 '15 18:02 KlustoR

everything seems fine now, thanks for the fix :+1:

KlustoR avatar Feb 18 '15 20:02 KlustoR

I am still having this issue with Semantic-ui 2.1.5. only dropdown doesn't validate onBlur.
I am using semantic ui with React framework.
Demo site seems to have same issue too. http://semantic-ui.com/behaviors/form.html#/examples

utsavig avatar Feb 11 '16 04:02 utsavig

Echoing @utsavig, dropdown doesn't validate on blur.

godspeed97 avatar Nov 28 '16 15:11 godspeed97

I'm using semantic-ui-dropdown npm package. To fix @utsavig problem, I added :

$input.trigger('blur');

to the blur method on line 927

blur: function(event) {
   $input.trigger('blur');
      pageLostFocus = (document.activeElement === this);
      if(!activated && !pageLostFocus) {
         module.remove.activeLabel();
            module.hide();
     }
}

kungfuyou avatar Mar 02 '17 14:03 kungfuyou

Still seeing the 'blur' problem in 2.3.1 and on the examples page.

Im using this for now:

  $('.ui.dropdown').on('blur', function () {
    setTimeout(function ($e) { $e.find('input,select').trigger('blur') }, 1, $(this))
  })

The setTimeout is there to avoid a flash of the error prompt when selecting a value. Hope someone else finds it useful.

mckinley avatar Aug 09 '18 17:08 mckinley