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

fix(datepicker): navigation arrow class override #3922

Merged
merged 1 commit into from
May 25, 2023

Conversation

ravi9115
Copy link
Contributor

Before submitting a pull request, please make sure you have at least performed the following:

  • read and followed the CONTRIBUTING.md and DEVELOPER.md guide.
  • built and tested the changes locally.
  • added/updated any applicable tests.
  • added/updated any applicable API documentation.
  • added/updated any applicable demos.

Related issue is: #3872
demo

@codecov-io
Copy link

codecov-io commented Dec 26, 2020

Codecov Report

Merging #3922 (1390f3c) into master (038e89a) will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3922      +/-   ##
==========================================
+ Coverage   91.26%   91.32%   +0.06%     
==========================================
  Files         110      110              
  Lines        3159     3170      +11     
  Branches      608      612       +4     
==========================================
+ Hits         2883     2895      +12     
  Misses        195      195              
+ Partials       81       80       -1     
Flag Coverage Δ
e2e 49.52% <ø> (-0.12%) ⬇️
unit 88.01% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/datepicker/datepicker-navigation.ts 100.00% <ø> (ø)
src/nav/nav-transition.ts 100.00% <0.00%> (ø)
src/nav/nav-outlet.ts 95.00% <0.00%> (+4.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 038e89a...1390f3c. Read the comment docs.

Copy link
Member

@maxokorokov maxokorokov left a comment

Choose a reason for hiding this comment

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

Hey @ravi9115,

thanks for the PR.

This would be somehow a breaking change for those overriding .right class.
I've opened the #3931 to do what was suggested in the original issue for now.

I still think we should do what you're suggesting in one of the future major releases, but I would also prefer to rename the class to one of the options:

<!-- now -->
<div class="ngb-dp-arrow">
<div class="ngb-dp-arrow right">

<!-- suggestion similar to bootstrap's carousel -->

<div class="ngb-dp-arrow-prev">
<div class="ngb-dp-arrow-next">

<!-- OR  similar to buttons -->

<div class="ngb-dp-arrow ngb-dp-arrow-prev">
<div class="ngb-dp-arrow ngb-dp-arrow-next">

"Right" doesn't make much sense... especially with future RTL support.

cc @ExFlo

WDYT?

@ravi9115
Copy link
Contributor Author

ravi9115 commented Jan 9, 2021

Hi @maxokorokov ,

Thanks for your review. As per your suggestion I've remained the classes similar to bootstrap's carousel. Please review the same.

PS: it's my first open source contribution so let me know you have some suggestions on this PR

Copy link
Member

@maxokorokov maxokorokov left a comment

Choose a reason for hiding this comment

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

Thanks, @ravi9115!

LGTM apart from forgotten .right, please update.

I'll schedule it for the 10.0.0 when we'll be moving to BS5 and there will be a lot of similar changes.

@@ -31,7 +31,7 @@ import {NgbDatepickerI18n} from './datepicker-i18n';
</div>
<div class="ngb-dp-arrow" *ngIf="i !== months.length - 1"></div>
</ng-template>
<div class="ngb-dp-arrow right">
<div class="ngb-dp-arrow-next right">
Copy link
Member

Choose a reason for hiding this comment

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

We don't need .right here anymore, do we?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we won't need .right here. I'll remove it

@maxokorokov maxokorokov added this to the 10.0.0 milestone Jan 12, 2021
@fbasso fbasso modified the milestones: 12.0.0, 12.1.0 Feb 14, 2022
@maxokorokov maxokorokov modified the milestones: 12.1.0, 12.2.0 Apr 28, 2022
@maxokorokov maxokorokov modified the milestones: 13.1.0, 14.0.0 Aug 25, 2022
@maxokorokov maxokorokov modified the milestones: 14.0.0, 14.1.0 Dec 7, 2022
@maxokorokov maxokorokov modified the milestones: 14.1.0, 14.2.0 Apr 3, 2023
@maxokorokov maxokorokov modified the milestones: 14.2.0, 14.1.1 Apr 13, 2023
@maxokorokov maxokorokov modified the milestones: 14.1.1, 15.0.0 Apr 27, 2023
Forgotten during BS5 migration, `right` should become `next`.

BREAKING CHANGE:

Might be breaking, if arrows are customized.
Datepicker navigation arrow markup.

BEFORE:
```html
<div class="ngb-dp-arrow">       <!-- left -->
<div class="ngb-dp-arrow right"> <!-- right -->
```

AFTER:
```html
<div class="ngb-dp-arrow ngb-dp-arrow-prev"> <!-- prev -->
<div class="ngb-dp-arrow ngb-dp-arrow-next"> <!-- next -->
```
@maxokorokov maxokorokov merged commit 3735699 into ng-bootstrap:master May 25, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants