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

Add picker.clear({muted: true}). #406

Closed
sergeny opened this issue Apr 21, 2014 · 1 comment
Closed

Add picker.clear({muted: true}). #406

sergeny opened this issue Apr 21, 2014 · 1 comment
Labels
Milestone

Comments

@sergeny
Copy link

sergeny commented Apr 21, 2014

Currently I see no proper way of achieving this. I also tried picker.set('clear', {muted:true}) as well as picker.set('select', 'clear', {muted:true}).

Scenario: I am doing an AJAX PUT after the picker is modified. If it fails, I want to revert back. I have no problem reverting to an actual date, but I can't revert to a no date, because clearing the picker triggers the callback, which tries another ajax request, which also fails, and so on... (infinite recursion).

Workaround: disconnect the callback, clear, reconnect the callback.

@amsul
Copy link
Owner

amsul commented Apr 24, 2014

Ah, I see the problem here. The best way to do this at the moment would be something like this:

picker.set('clear', null, {muted: true})

The picker.clear alias doesn't pass options to the set method. This will be fixed in a future release. For now you can rely on the method mentioned above :)

@amsul amsul added this to the v3.6.0 milestone Apr 24, 2014
@amsul amsul modified the milestones: 3.5.3, v3.6.0 May 28, 2014
@amsul amsul removed the todo label Jul 6, 2014
@amsul amsul closed this as completed in c8c8722 Jul 6, 2014
amsul added a commit that referenced this issue Dec 6, 2014
Conflicts:
	CHANGELOG.md
	_docs/CHANGELOG.md
	lib/compressed/picker.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants