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

Drag and Drop cdkDropListDisabled odd binding #17325

Closed
wratho opened this issue Oct 8, 2019 · 3 comments · Fixed by #17330 or hrueger/AGLight#112
Closed

Drag and Drop cdkDropListDisabled odd binding #17325

wratho opened this issue Oct 8, 2019 · 3 comments · Fixed by #17330 or hrueger/AGLight#112
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@wratho
Copy link

wratho commented Oct 8, 2019

Reproduction

https://stackblitz.com/edit/angular-bj2u4w (working example)
https://stackblitz.com/edit/angular-4pnl1v (broken example)

When you the cdkDropListDisabled limit it appears that the next operation isn't setting the disable back to enabled.

In these examples there is a limit on the todo where the todo list should be drag disabed when it has only 1 item and the done list should be drag disabled when the todo list has 6 or more in it.

Reproduce:
Move all but 1 item from todo and notice that you cannot move the final item out of todo list.
Move 1 from done back to todo. This SHOULD allow you to move an item from todo back to done since the limit for cdkDropListDisabled has been removed.
Notice that you cannot move from todo until you move a 3rd into todo. It is fixed if you drop or even just enter the 3rd item into the todo list.

other way of breaking:
Move 6 items into todo and notice you cannot move a 7th item into todo
Move 1 from todo to done. This SHOULD allow you to move an item from done into todo.
Notice you cannot move from done into todo until you reduce the todo count to 4. It is fixed by dropping OR simply entering the done list from todo.

Expected Behavior

When the cdkDropListDisabled becomes false it should actually let me interact with the draggable list again.

Actual Behavior

cdkDropListDisabled is not re-enabling the list after the first operation that makes it false.

Environment

  • Angular: 8.2
  • CDK/Material: 8.2
  • Browser(s): Edge, Chrome, Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
@crisbeto crisbeto self-assigned this Oct 8, 2019
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Oct 8, 2019
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 8, 2019
Usually we only sync up the drop list ref with the directive right before dragging starts, however if the disabled state is set, it can propagate to the child directives and prevent the user from ever starting a search again. These changes make it so whenever the disable state is set it'll get sync immediately.

Also changes a misleading method name.

Fixes angular#17325.
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 8, 2019
Usually we only sync up the drop list ref with the directive right before dragging starts, however if the disabled state is set, it can propagate to the child directives and prevent the user from ever starting a search again. These changes make it so whenever the disable state is set it'll get sync immediately.

Also changes a misleading method name.

Fixes angular#17325.
@wratho
Copy link
Author

wratho commented Oct 8, 2019

Thanks for the quick turn around on this!

crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 19, 2019
Usually we only sync up the drop list ref with the directive right before dragging starts, however if the disabled state is set, it can propagate to the child directives and prevent the user from ever starting a search again. These changes make it so whenever the disable state is set it'll get sync immediately.

Also changes a misleading method name.

Fixes angular#17325.
jelbourn pushed a commit that referenced this issue Nov 20, 2019
Usually we only sync up the drop list ref with the directive right before dragging starts, however if the disabled state is set, it can propagate to the child directives and prevent the user from ever starting a search again. These changes make it so whenever the disable state is set it'll get sync immediately.

Also changes a misleading method name.

Fixes #17325.
@wratho
Copy link
Author

wratho commented Nov 25, 2019

Was curious when we were expecting this to be live.

jelbourn pushed a commit that referenced this issue Nov 25, 2019
…7330)

Usually we only sync up the drop list ref with the directive right before dragging starts, however if the disabled state is set, it can propagate to the child directives and prevent the user from ever starting a search again. These changes make it so whenever the disable state is set it'll get sync immediately.

Also changes a misleading method name.

Fixes #17325.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants