Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onchange of select #71

Open
priyankoctal opened this issue Feb 19, 2019 · 1 comment
Open

onchange of select #71

priyankoctal opened this issue Feb 19, 2019 · 1 comment

Comments

@priyankoctal
Copy link

I have a dropdown of country list. I set a function which get call at onChange event and console the current selected value. When I type IN then its getiing called two times

so console show Iceland and India, general dropdown dont do so

@mpodorov
Copy link

mpodorov commented Sep 13, 2019

Moreover, the change event is generated when the item which is already selected is selected again. Native selects do not behave this way.

See the code:

		onSelect: function() {
			this.refresh();

			if (this.realElement.prop('multiple')) {
				this.repositionDropdown();
			} else {
				this.hideDropdown();
			}

			this.fireNativeEvent(this.realElement, 'change');
		},

'change' event is triggered even if we don't change the selection. This must be fixed by checking the selected item before triggering the event here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants