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

prototype(chips): MDC chip APIs match existing APIs #16145

Merged
merged 1 commit into from
Jun 24, 2019

Conversation

vanessanschmitt
Copy link
Collaborator

Work in progress, just looking for feedback! Will keep updating as I work.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 29, 2019
@vanessanschmitt vanessanschmitt changed the title prototype(mat-chip-list): WIP MDC chips prototype(chips): MDC chip APIs match existing APIs Jun 14, 2019
@vanessanschmitt
Copy link
Collaborator Author

Hey! I pushed the new MDC chip classes with the structure we discussed. I'm looking to get feedback on this partial implementation, and ideally get it submitted on its own.

Known big missing things:

  • MatChipGrid/MatChipRow do not have focus management/arrow key navigation implemented yet. I'm thinking I'll have to write some custom logic for them, since I don't see a grid equivalent of FocusKeyManager. Wanted to check in with you all before I go ahead and write that!

Open questions:

  • I currently have MatChipListbox implementing just ControlValueAccessor, and MatChipGrid implementing both ControlValueAccessor and MatFormFieldControl. Does that make sense?

Next steps:

  • Add keyboard navigation/focus management for MatChipGrid/MatChipRow (separate PR)
  • Copy existing tests and ensure they all pass (separate PR)

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.

Overall looks good to me. This made me realize we have some stale patterns in the chip-list that we should clean up eventually (like overuse of any in the value space), but that's a job for another time.

src/material-experimental/mdc-chips/_mdc-chips.scss Outdated Show resolved Hide resolved
/** Default options, for the chips module, that can be overridden. */
export interface MatChipsDefaultOptions {
/** The list of key codes that will trigger a chipEnd event. */
separatorKeyCodes: number[] | Set<number>;
Copy link
Member

Choose a reason for hiding this comment

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

FYI we decided just two days ago that we're going to change the way we handle these separator keys in the chips. It turns out that virtual keyboards on iOS and Android don't actually send keyCodes (or Keyboardevent.key), so we're going to deprecate this API and and change to something like delimiterCharacters and instead base the behavior off of the value in the input, with special casing for tab and enter. No action required for right now, but worth keeping in mind when you get to the board handling. I'll be sure to keep you in the loop when we figure out the final behavior we want.

cc @josephperrott

src/material-experimental/mdc-chips/chip-grid.ts Outdated Show resolved Hide resolved
src/material-experimental/mdc-chips/chip-listbox.ts Outdated Show resolved Hide resolved
src/material-experimental/mdc-chips/chip-option.html Outdated Show resolved Hide resolved
src/material-experimental/mdc-chips/chip.ts Outdated Show resolved Hide resolved
notifyTrailingIconInteraction: () => this.trailingIconInteraction.emit(this.id),
notifyRemoval: () => this.removed.emit({chip: this}),
getComputedStyleValue: (propertyName) => {
return window.getComputedStyle(this._mdcChip.nativeElement).getPropertyValue(propertyName);
Copy link
Member

Choose a reason for hiding this comment

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

@mmalerba will this cause a problem with SSR?

@vanessanschmitt

This comment has been minimized.

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.

Last a few last things I noticed on another pass

src/material-experimental/mdc-chips/chips.scss Outdated Show resolved Hide resolved
src/material-experimental/mdc-chips/chip.ts Outdated Show resolved Hide resolved
src/material-experimental/mdc-chips/chip-option.ts Outdated Show resolved Hide resolved
src/material-experimental/mdc-chips/chip-row.ts Outdated Show resolved Hide resolved
@jelbourn
Copy link
Member

For the build issue:

  • It's missing a dep in the sass_binary: "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib"
  • Also, the version of material-components-web in the package.json needs to be updated. It looks like ^2.3.1 will work

@vanessanschmitt
Copy link
Collaborator Author

I updated the version of material-components-web in package.json, and 'yarn test' started passing locally. When I pushed to Github, I got yarn.lock out of date errors. I ran 'yarn install' to update it, and pushed again. Now everything on circle cl is failing at the restore cache step with permission denied errors. Is this expected?

@jelbourn
Copy link
Member

Looks like the CI might just be a transient error? I'd try rebasing and pushing again

cc @devversion

@devversion
Copy link
Member

@jelbourn I think that I caused this issue while working on the Angular update where I might have stored a new cache entry in CircleCI (with a new docker image user). Rebasing should ensure that a more recent cache entry is used (which should not be polluted by my Angular update PR)

@vanessanschmitt
Copy link
Collaborator Author

vanessanschmitt commented Jun 19, 2019

I rebased and pushed again, but I'm still getting the same permission denied errors.

commit 273f8a2ecf6dde4b5db78e27ced45d093126f4fb (HEAD -> devel, origin/devel)
Author: Vanessa Schmitt <[email protected]>
Date:   Fri Jun 14 11:16:45 2019 -0700

    prototype(chips): MDC chip APIs match existing APIs

commit 7a04788cd32e1b37693e4dd9784ca986c5d28f85 (upstream/master, master)
Author: Kristiyan Kostadinov <[email protected]>
Date:   Wed Jun 19 07:25:07 2019 +0200

cc @devversion

@jelbourn
Copy link
Member

@devversion any further ideas? I tried this on another PR (#16335) and the same thing happens. I don't see anything in the CircleCI UI to manually clear the cache like existed in Travis. Could it have anything to do with the yarn version?

@devversion
Copy link
Member

@vanessanschmitt The issues have been sorted out. Can you please try to rebase? Thank you!

@jelbourn jelbourn added the target: minor This PR is targeted for the next minor release label Jun 24, 2019
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 Jun 24, 2019
@jelbourn jelbourn merged commit 86aad59 into angular:master Jun 24, 2019
@vanessanschmitt vanessanschmitt deleted the devel branch June 24, 2019 21:33
@vanessanschmitt
Copy link
Collaborator Author

related to #16173

@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.

5 participants