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

disabled Prop #142

Closed
Toilal opened this issue May 9, 2017 · 6 comments
Closed

disabled Prop #142

Toilal opened this issue May 9, 2017 · 6 comments
Labels

Comments

@Toilal
Copy link

Toilal commented May 9, 2017

Would you consider a pull request adding a disabled Prop mapping to disabled sortableJS option ?

@David-Desmaisons
Copy link
Member

Hello @Toilal, it is already possible to use disable option using the options props.

@Toilal
Copy link
Author

Toilal commented May 9, 2017

Only issue when using options property is that watcher is not declared on options.disabled (L#136). So I need to clone the option object in order the watcher to be triggered.

(I use TypeScript and vue-class-component)

draggableOptions = {disabled: false};

@Watch('modalOpened')
onModalOpened(opened: boolean) {
  let options = _.clone(this.draggableOptions);
  options.disabled = opened;
  this.draggableOptions = options;
}
<draggable v-model="wrappers" :options="draggableOptions">
  ...
</draggable>

@David-Desmaisons
Copy link
Member

@Toilal , Could you create a jsfidle with a similar issue?
I guess using a deep watcher would solve the issue, with a jsfidle I can make sure that the fix is correct.
The weird thing is that the behaviour is ok in this example:
Disable.html

@Toilal
Copy link
Author

Toilal commented May 10, 2017

@Toilal
Copy link
Author

Toilal commented May 10, 2017

btw, this library still rock :) 👍

@David-Desmaisons
Copy link
Member

Hello @Toilal , thanks for the jsfiddle using deep watch solve the issue.
The fix is available in version 2.11.0

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