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

feat(drag-drop): add class to indicate whether a container can receiv… #14532

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

crisbeto
Copy link
Member

Adds the cdk-drop-list-receiving class to drop containers that are able to receive the item that is currently being dragged. This class can be used to indicate to the user where they can drop an item.

Fixes #14439.

…e an item

Adds the `cdk-drop-list-receiving` class to drop containers that are able to receive the item that is currently being dragged. This class can be used to indicate to the user where they can drop an item.

Fixes angular#14439.
@crisbeto crisbeto added the target: minor This PR is targeted for the next minor release label Dec 15, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 15, 2018
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Dec 17, 2018
@ngbot
Copy link

ngbot bot commented Dec 17, 2018

I see that you just added the pr: merge ready label, but the following checks are still failing:
    failure status "branch-manager" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@jelbourn jelbourn merged commit c6dc070 into angular:master Dec 18, 2018
josephperrott pushed a commit to josephperrott/components that referenced this pull request Jan 14, 2019
…e an item (angular#14532)

Adds the `cdk-drop-list-receiving` class to drop containers that are able to receive the item that is currently being dragged. This class can be used to indicate to the user where they can drop an item.

Fixes angular#14439.
devversion added a commit to devversion/material2 that referenced this pull request May 28, 2019
Currently when someone uses single quote import declarations in
their project and the `ng update` migration for Material runs, the
Material imports are rewritten into multiple imports referring to
individual secondary entry-points, but the actual existing quote
style is ignored. This means that the linter can sometimes complain
after the migration has been performed.

Ideally we'd run the tslint fix task after the migration ran in order to
fix all lint rule failures which are specific to the given project, but this
is not a best-practice yet and we need to decide on the CLI-side whether
the CLI should automatically run the fixers after generator/migration
schematics ran. See: angular/angular-cli#14532

Unfortunately we can't do the same thing for the whitespace within
the `NamedImports` declaration because the whitespace for object
literal expressions is hard-coded. See:

https://github.com/microsoft/TypeScript/blob/6a559e37ee0d660fcc94f086a34370e79e94b17a/src/compiler/emitter.ts#L3796-L3797
(`emitObjectLiteralExpression` does not allow configuring the format flags)

Fixes angular#14532
jelbourn pushed a commit that referenced this pull request May 28, 2019
…#16131)

Currently when someone uses single quote import declarations in
their project and the `ng update` migration for Material runs, the
Material imports are rewritten into multiple imports referring to
individual secondary entry-points, but the actual existing quote
style is ignored. This means that the linter can sometimes complain
after the migration has been performed.

Ideally we'd run the tslint fix task after the migration ran in order to
fix all lint rule failures which are specific to the given project, but this
is not a best-practice yet and we need to decide on the CLI-side whether
the CLI should automatically run the fixers after generator/migration
schematics ran. See: angular/angular-cli#14532

Unfortunately we can't do the same thing for the whitespace within
the `NamedImports` declaration because the whitespace for object
literal expressions is hard-coded. See:

https://github.com/microsoft/TypeScript/blob/6a559e37ee0d660fcc94f086a34370e79e94b17a/src/compiler/emitter.ts#L3796-L3797
(`emitObjectLiteralExpression` does not allow configuring the format flags)

Fixes #14532
RudolfFrederiksen pushed a commit to RudolfFrederiksen/material2 that referenced this pull request Jun 21, 2019
…angular#16131)

Currently when someone uses single quote import declarations in
their project and the `ng update` migration for Material runs, the
Material imports are rewritten into multiple imports referring to
individual secondary entry-points, but the actual existing quote
style is ignored. This means that the linter can sometimes complain
after the migration has been performed.

Ideally we'd run the tslint fix task after the migration ran in order to
fix all lint rule failures which are specific to the given project, but this
is not a best-practice yet and we need to decide on the CLI-side whether
the CLI should automatically run the fixers after generator/migration
schematics ran. See: angular/angular-cli#14532

Unfortunately we can't do the same thing for the whitespace within
the `NamedImports` declaration because the whitespace for object
literal expressions is hard-coded. See:

https://github.com/microsoft/TypeScript/blob/6a559e37ee0d660fcc94f086a34370e79e94b17a/src/compiler/emitter.ts#L3796-L3797
(`emitObjectLiteralExpression` does not allow configuring the format flags)

Fixes angular#14532
@MNorgren
Copy link

Is there a way we can keep this cdk-drop-list-receiving class applied to the CdkDropList even while dragging? Once the CdkDrag gets over the container, the class is removed and replaced with the .cdk-drop-list-dragging. Can we keep both classes?

@crisbeto
Copy link
Member Author

@MNorgren I feel like that could be confusing. Once the item is inside a new container, the container isn't really receiving anymore, it has received the item already. If you want to capture both states you can target both the -receiving and -dragging classes.

@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 Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drag Drop- apply class to all linked drop lists
4 participants