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(datepicker): polish up date range selector #18531

Merged
merged 1 commit into from Feb 20, 2020

Conversation

crisbeto
Copy link
Member

Makes a bunch of changes to polish up the behavior of the date range picker.

  • Makes the range selection logic a bit smarter about when to pick start/end so that it's more intuitive.
  • Fixes hovering over disabled cells triggering the range selection styles.
  • Fixes a "changed after checked" error when selecting a range using the keyboard.
  • Implements validation that the start isn't after the end, and that the end isn't before the start.
  • Adds the missing ARIA attributes.
  • Fixes being able to select the placeholders of a disabled range input.
  • Adds the ability to disable the entire range input.
  • Fixes the inputs not graying out their values when they're disabled.
  • Makes the range input a bit smarter about which input to focus on click.

With these changes the date range picker should be mostly feature-complete.

Makes a bunch of changes to polish up the behavior of the date range picker.

- Makes the range selection logic a bit smarter about when to pick start/end so that it's more intuitive.
- Fixes hovering over disabled cells triggering the range selection styles.
- Fixes a "changed after checked" error when selecting a range using the keyboard.
- Implements validation that the start isn't after the end, and that the end isn't before the start.
- Adds the missing ARIA attributes.
- Fixes being able to select the placeholders of a disabled range input.
- Adds the ability to disable the entire range input.
- Fixes the inputs not greying out their values when they're disabled.
- Makes the range input a bit smarter about which input to focus on click.
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent pr: merge safe labels Feb 17, 2020
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 17, 2020
},
providers: [
{provide: NG_VALUE_ACCESSOR, useExisting: MatStartDate, multi: true},
{provide: NG_VALIDATORS, useExisting: MatStartDate, multi: true}
]
})
export class MatStartDate<D> extends _MatDateRangeInputBase<D> implements CanUpdateErrorState {
// TODO(crisbeto): start-range-specific validators should go here.
protected _validator = Validators.compose(super._getValidators());
/** Validator that checks whether the start date isn't after the end date. */
Copy link
Contributor

Choose a reason for hiding this comment

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

wording nit: whether --> that

},
providers: [
{provide: NG_VALUE_ACCESSOR, useExisting: MatEndDate, multi: true},
{provide: NG_VALIDATORS, useExisting: MatEndDate, multi: true}
]
})
export class MatEndDate<D> extends _MatDateRangeInputBase<D> implements CanUpdateErrorState {
// TODO(crisbeto): end-range-specific validators should go here.
protected _validator = Validators.compose(super._getValidators());
/** Validator that checks whether the end date isn't before the start date. */
Copy link
Contributor

Choose a reason for hiding this comment

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

wording nit: see above

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Feb 20, 2020
@andrewseguin andrewseguin merged commit de778a9 into angular:date-range Feb 20, 2020
@crisbeto
Copy link
Member Author

ops, looks like this one got in before I had a chance to address the nits. I'll just push it directly to the date-range branch.

crisbeto added a commit that referenced this pull request Feb 26, 2020
Makes a bunch of changes to polish up the behavior of the date range picker.

- Makes the range selection logic a bit smarter about when to pick start/end so that it's more intuitive.
- Fixes hovering over disabled cells triggering the range selection styles.
- Fixes a "changed after checked" error when selecting a range using the keyboard.
- Implements validation that the start isn't after the end, and that the end isn't before the start.
- Adds the missing ARIA attributes.
- Fixes being able to select the placeholders of a disabled range input.
- Adds the ability to disable the entire range input.
- Fixes the inputs not greying out their values when they're disabled.
- Makes the range input a bit smarter about which input to focus on click.
crisbeto added a commit that referenced this pull request Mar 12, 2020
Makes a bunch of changes to polish up the behavior of the date range picker.

- Makes the range selection logic a bit smarter about when to pick start/end so that it's more intuitive.
- Fixes hovering over disabled cells triggering the range selection styles.
- Fixes a "changed after checked" error when selecting a range using the keyboard.
- Implements validation that the start isn't after the end, and that the end isn't before the start.
- Adds the missing ARIA attributes.
- Fixes being able to select the placeholders of a disabled range input.
- Adds the ability to disable the entire range input.
- Fixes the inputs not greying out their values when they're disabled.
- Makes the range input a bit smarter about which input to focus on click.
crisbeto added a commit that referenced this pull request Mar 17, 2020
Makes a bunch of changes to polish up the behavior of the date range picker.

- Makes the range selection logic a bit smarter about when to pick start/end so that it's more intuitive.
- Fixes hovering over disabled cells triggering the range selection styles.
- Fixes a "changed after checked" error when selecting a range using the keyboard.
- Implements validation that the start isn't after the end, and that the end isn't before the start.
- Adds the missing ARIA attributes.
- Fixes being able to select the placeholders of a disabled range input.
- Adds the ability to disable the entire range input.
- Fixes the inputs not greying out their values when they're disabled.
- Makes the range input a bit smarter about which input to focus on click.
crisbeto added a commit that referenced this pull request Mar 21, 2020
Makes a bunch of changes to polish up the behavior of the date range picker.

- Makes the range selection logic a bit smarter about when to pick start/end so that it's more intuitive.
- Fixes hovering over disabled cells triggering the range selection styles.
- Fixes a "changed after checked" error when selecting a range using the keyboard.
- Implements validation that the start isn't after the end, and that the end isn't before the start.
- Adds the missing ARIA attributes.
- Fixes being able to select the placeholders of a disabled range input.
- Adds the ability to disable the entire range input.
- Fixes the inputs not greying out their values when they're disabled.
- Makes the range input a bit smarter about which input to focus on click.
@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 Mar 22, 2020
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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants