DatePicker with adaptivePosition true is rendering off the view port when in a narrow scroll parent
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angular, typescript
- Domain
- frontend
Research direction
Start with src/datepicker/themes/bs/bs-daterangepicker-container.component.ts around the linked configuration at lines 117–119, then trace how the date picker config reaches the position service and how preventOverflow chooses its boundary. Use the StackBlitz reproduction to check behavior in a narrow scroll parent. Done when the picker stays within the viewport and respects its configured placement unless overflow prevention flips it.
Written by the indexing model from the issue text.
Description
Bug description:
The DatePicker is setting its boundariesElement to the scroll parent. This is causing the adaptive positioning to limit where the date picker appears based on the width and size of the scroll parent.
Plunker/StackBlitz that reproduces the issue:
The placement is to the right, but it is limited to the right by the scroll parent and thus flipping to render left and rendering off the view port.
https://stackblitz.com/edit/stackblitz-starters-zcm9m6eu?file=package.json
Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 20.0.2
Angular: 20.1.3
Bootstrap: 4.3.2
Build system: Angular CLI
Expected behavior
The date picker to render to the correctly specified placement unless the preventOverflow triggers and flips the location. The date picker should not be cut off or rendered off the screen.
Thoughts
Would it be possible to pass along an optional boundariesElement to the configuration so that it would be possible to use the viewport instead of the scrollParent?
Something like this perhaps?
this._positionService.setOptions({
modifiers: {
flip: {
enabled: this._config.adaptivePosition
},
preventOverflow: {
enabled: this._config.adaptivePosition,
boundariesElement: this._config.boundariesElement
}
},
allowedPositions: this._config.allowedPositions
});
- Dominant language
- TypeScript
- Stars
- 5.5k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from valor-software/ngx-bootstrap
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
valor-software/ngx-bootstrap#6836 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
valor-software/ngx-bootstrap#6834 ·
-
comp(pagination)
Difficulty 1/5 Under an hour Newbie friendliness 76/100
valor-software/ngx-bootstrap#6807 · 4 comments · 3 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 67/100
valor-software/ngx-bootstrap#6799 ·
-
Date picker and range picker still accept selection after the form control is disabledPossibly taken @Xapollon430 claimed this 2 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
valor-software/ngx-bootstrap#6839 ·
All issues in valor-software/ngx-bootstrap
Similar issues
-
bug parity
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
WenyuChiou/agent-board#1489 ·
Maintainers usually reply within 1 day
-
area: bazaar bug complexity: medium
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
accensa/x402-facilitator-stellar#779 ·
Maintainers usually reply within 1 day
-
bug good first issue P4 size:S web-ui
Difficulty 2/5 Half a day Newbie friendliness 85/100
josephfung/curia#2600 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cloudflare/partykit#444 ·