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

Unable to remove loading class on dropdown with select

Open craigh411 opened this issue 9 years ago • 4 comments

When using dropdown with select, I'm unable to remove the the loading class, so the spinner remains after data has loaded, however, the removal works fine when using dropdown with a div, which unfortunately I'm not able to do, because I'm binding the dropdown selections to underlying data, which requires the select input,

JSFiddle for reproduction of the issue

https://jsfiddle.net/ddfyrz5a/

craigh411 avatar Feb 07 '17 13:02 craigh411

If you would inspect the select#dd-select element, you would see that it does not have class attribute, but the parent element does, and it has "loading" class. Try $('#dd-select').parent().removeClass('loading') instead of $('#dd-select').removeClass('loading')

ciajulius avatar Feb 07 '17 15:02 ciajulius

Ah, that's a shame. I'm using vue.js which will not handle this scenario, and I would prefer not to touch the DOM too much myself if there's an alternative (although I am having to get quite creative with the dropdown). I suppose it's just one of those things, MVVM doesn't mix well with jQuery, but the dropdowns are really nice so I'm willing to put the extra effort in to get them to play nice with vue. Anyway, it doesn't look like a bug so I'll close this issue.

craigh411 avatar Feb 07 '17 16:02 craigh411

Hi @craigh411, maybe you could try utilizing v-bind somehow?

awgv avatar Feb 07 '17 19:02 awgv

@Banandrew Thanks for the suggestion. Unfortunately, v-bind won't work if the select is wrapped in an outer div after mounting and the class applied to that, which was the problem I was encountering in the first place. In the end I've just abandoned the idea of placing the loading class directly on the select and am using a Loader for the entire form, which works perfectly. The only other solution I can see is to remove the class from the outer div directly, which is something I may have to do in future.

craigh411 avatar Feb 08 '17 12:02 craigh411