-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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(dropdown): wrong positioning calculation #3058
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3058 +/- ##
==========================================
- Coverage 92.27% 90.83% -1.45%
==========================================
Files 91 90 -1
Lines 3015 2999 -16
Branches 485 484 -1
==========================================
- Hits 2782 2724 -58
- Misses 171 207 +36
- Partials 62 68 +6
Continue to review full report at Codecov.
|
e368fb9
to
de3fda9
Compare
c9afe6f
to
273aa85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Could you pease just make the test description clearer ?
src/dropdown/dropdown.spec.ts
Outdated
const dropdownElement = document.querySelector('div[ngbDropdownMenu]'); | ||
const parentContainer = dropdownElement.parentNode; | ||
expect(parentContainer).toHaveCssClass('dropdown'); | ||
expect(parentContainer.parentNode).toBe(document.body, 'The dropdown should be attached to the body'); | ||
|
||
}); | ||
|
||
it('should toggle at the second placement if needed', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should second placement if the first one doesn't fit
?
src/dropdown/dropdown.spec.ts
Outdated
fixture.detectChanges(); | ||
const dropdownEl = compiled.querySelector('[ngbdropdownmenu]'); | ||
const targetElement = compiled.querySelector('button'); | ||
// expect(dropdownElement.getAttribute('x-placement')).toBe('right'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove or uncomment
273aa85
to
b5f8a07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
fix #3056
The fix only adds the 'show' class before the positioning, but I don't know if it's the best solution as the class attribute is bound. I tried to 'unbind' the class, but it's much more painfull.