Repository navigation
Description
What would you like to be added? 💡
A public API for an app to end the current autofill session: tell the platform the form was submitted (offer to save the credentials) or abandoned (discard them). This is the equivalent of AutofillManager.commit() / cancel() on Android.
With #26609, Skia Android exposes TextBox/PasswordBox fields to the autofill service and reports when they become hidden. Android only offers to save credentials when every field of the session is gone, so today the save prompt shows only when the form is navigated away from or collapsed.
The plumbing already exists, but is not reachable by apps:
ITextBoxNotificationsProviderSingleton.FinishAutofillContext(bool shouldSave), implemented on Android (TextInputPlugin.FinishAutofillContext→Commit()/Cancel()), no-op on the other Skia hosts.- The public entry point
FinishAutofillContext(bool shouldSave), marked// TODO: Discuss this public API., was disabled in 163100d (now inTextBoxCore.Input.csunder#if false).
Possible shape, next to the other Uno-specific TextBox APIs:
// After a successful login:
Uno.UI.Xaml.Controls.TextBoxExtensions.FinishAutofillContext(shouldSave: true);- Android:
AutofillManager.Commit()/Cancel()for the autofill session of the window. - iOS: to be checked whether the Skia host has an equivalent; no-op otherwise.
- Other Skia targets: no-op.
Open questions: a static method vs. something scoped to a XamlRoot/window, and the name (FinishAutofillContext vs. CommitAutofill/CancelAutofill).
Why is this needed? 🤔
A login form that stays on screen after submitting (a single-page app, an inline error, a dialog that only updates its content) never hides its fields, so the user is never offered to save the credentials. Native Android apps call AutofillManager.commit() in that case.
For which platforms 📱💻🖥️
Android, iOS
Anything else we need to know? 💬
Follow-up of #26609 (Android autofill for Skia text inputs, part of #26610), raised during its review. Related: #26664 (opt a TextBox out of autofill), which could share the same API class.
Activity