https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41129

--- Comment #52 from Paul Derscheid <[email protected]> ---
Created attachment 200584
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200584&action=edit
Bug 41129: (follow-up) Fall back to setTimeout when requestIdleCallback is
missing

- Vue island hydration called window.requestIdleCallback directly,
  which throws TypeError on iOS Safari < 17.4 and prevents the
  booking-modal-island custom element from being defined; trigger
  buttons then silently set a property on a plain HTMLElement
- Add a module-level scheduleIdle shim that uses requestIdleCallback
  when available and falls back to setTimeout(cb, 1) otherwise; the
  hydrate callback never reads the idle deadline, so the fallback is
  behaviour-equivalent on engines lacking native support

Test plan:
1. yarn js:build
2. Regression (requestIdleCallback present): open a staff catalogue
   detail page for a biblio with bookable items and confirm "Place
   booking" still opens the modal
3. Fallback (requestIdleCallback missing): test on iOS Safari < 17.4,
   or emulate it by injecting `delete window.requestIdleCallback;`
   as the first inline script of the page (e.g. via DevTools local
   overrides), reload, and confirm the island still hydrates and
   the button still opens the modal

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Assisted-by: Opus 4.8 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to