Aman-Mittal opened a new pull request, #547:
URL: https://github.com/apache/fineract-backoffice-ui/pull/547

   ## What changed
   
   - add `createPickersReady()` in `src/app/shared/utils/pickers-ready.ts`
   - hold every `ion-datetime-button` behind `@if (pickersReady())` across the 
**50 routed components** that carry the pattern — 72 buttons
   - add an e2e spec that enters the office and staff forms three times each 
without a reload, registered to run at **both the desktop and mobile viewports**
   
   Picker IDs are unchanged. The client form is fixed separately in #546; this 
PR leaves it alone to avoid a conflicting edit.
   
   ## Why
   
   `ion-datetime-button` resolves its target `ion-datetime` exactly once, in 
`componentWillLoad`, through a global `getElementById`, and gives up for good 
when that lookup misses. The pickers live inside 
`ion-modal[keepContentsMounted]`, whose contents Angular mounts later in the 
change-detection pass.
   
   On a first visit to a routed page the button's lazy Ionic chunk is still 
loading, which delays it past that point. On a revisit the chunk is cached, so 
the button initializes first, finds nothing, and renders a blank control that 
never opens. Reaching **any** of these forms a second time left every date 
field unusable until a full page reload — #541 is the client-form instance of 
it, reported because that is the busiest path.
   
   ## Scope, measured rather than assumed
   
   - **51 routed components, 75 buttons** carry the defect. Confirmed by 
browser repro on two unrelated pages: the client form (#541) and 
`/organization/offices/create`, which renders its opening-date picker on the 
first visit and a dead blank control on every visit after. No submit required — 
Cancel and re-enter is enough. 50 components / 72 buttons are in this PR; the 
client form's 3 are in #546.
   - **11 dialog components are not affected** and are left untouched. Opening 
`create-office-dialog` three times in a row renders correctly each time and 
logs nothing: an overlay mounts its contents before the button initializes. 
Verified, not inferred.
   
   ## Testing
   
   - `npm run build`, `npm run lint`, `npm run test:unit` (241 files, 1464 
tests passing)
   - `npm run i18n:check`, `npm run check:icons`, `npm run check:a11y-names`, 
`bash scripts/check-license.sh`
   - `npx playwright test date-picker-revisit --project=mocked` and 
`--project=mobile` — 2 passing each
   - With the component changes stashed, the spec fails at **both** viewports 
with `visit 2 left a picker unbound`, so the coverage is real in both
   
   `npm run format:check` reports pre-existing warnings under `_scratch/` and 
`LIVE_UI_BUGS.md`; no file in this change is listed.
   
   The spec reads each button's shadow root rather than its `textContent`, 
which is always empty and cannot tell a bound control from a dead one.
   
   ## Notes for review
   
   - `DUAL_VIEWPORT_SPECS` gains the glob `**/*date-picker-revisit.spec.ts` 
rather than a filename, so it also picks up the client-form spec in #546. Both 
PRs make that identical one-line edit, which merges cleanly in either order.
   - Two loose ends found while sweeping, deliberately not folded in: 
`loanMenu-trigger` is used as an `ion-popover` trigger ID by both `loan-view` 
and `wc-loan-view` (latent — overlays resolve `trigger` through the same 
one-shot `getElementById`, so two live pages would collide), and 
`loans/bulk-reassignment/bulk-reassignment.component.ts` appears to be dead 
code, referenced only by its own test while the routed component is 
`bulk-loan-reassignment.component.ts`.
   
   Related: #541, #546, #544


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to