Skip to content

Fix native search registration for lazy-loaded Ionic searchbars - #64

Merged
rdlabo merged 4 commits into
mainfrom
fix/readonly-searchbar-focus
Nov 20, 2026
Merged

rdlabo merged 4 commits into
mainfrom
fix/readonly-searchbar-focus

Conversation

@rdlabo

@rdlabo rdlabo commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Ionic's lazy loader exposes ion-searchbar.setFocus as a read-only prototype method. Registering a searchable tab could throw while wrapping that method and return the entire shell to Web presentation.

Install a temporary method on the searchbar instance. During teardown, restore the original own property descriptor or remove the wrapper to resume prototype lookup. Preserve a replacement installed by the app after registration.

The regression test covers both read-only and writable prototype methods. On an iPhone 17 Pro simulator running iOS 26.5, two Angular apps exercised Ionic 8.8.19 via IonicModule and standalone components. XCUITest verified that both stayed in native presentation, opened a UIKit search field, synchronized typed text to the Ionic searchbar, and preserved it after closing and reopening search.

Related to #62.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@rdlabo
rdlabo merged commit a8f903b into main Nov 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant