Skip to content

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Sep 7, 2024

Description of Change

When specifying Keyboard="Numeric/Plain/Telephone", the resulting keyboard on iOS lacks a dedicated "Done" button, making it difficult for users to dismiss the keyboard. This issue is further exacerbated by the fact that sometimes tapping outside the keyboard does not automatically hide it, leading to a frustrating user experience.

Issues Fixed

Fixes #24644
Fixes #19550
Fixes #29370

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-09-07.at.12.50.48.mp4

@kubaflo kubaflo requested review from a team as code owners September 7, 2024 11:55
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 7, 2024
@kubaflo kubaflo changed the base branch from net9.0 to main September 7, 2024 11:57
@mattleibow
Copy link
Member

@kubaflo is your description for another PR? It says ripple and button, but the PR is for iOS and Done.

@mattleibow
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mattleibow
Copy link
Member

Editor already has this logic in Core, should this rather be added there as a feature?

@kubaflo
Copy link
Contributor Author

kubaflo commented Sep 9, 2024

@kubaflo is your description for another PR? It says ripple and button, but the PR is for iOS and Done.

@mattleibow my bad 😅 I initially copied and pasted from this PR: #23599

@kubaflo
Copy link
Contributor Author

kubaflo commented Sep 9, 2024

Editor already has this logic in Core, should this rather be added there as a feature?

@mattleibow Yes that's right, editors have this button always enabled

@mattleibow
Copy link
Member

@PureWeen maybe this is better in Core for all Entry instances? Also, what if the user wants to hide from Editor? We added this for Editor without a way to disable, so maybe we need to come up with an API or something for net9.0?

@mattleibow
Copy link
Member

@tj-devel709 You are our resident "text entry" person/expert/guru...

Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

After a chat with some folks, I think this is worth making into an actual feature. We already do this for Editor, so making this work the same for Entry is a better thing.

Could this PR be updated to rather be a .NET 9 feature that basically always adds the Done button to Entry - just like we have in Editor.

@kubaflo
Copy link
Contributor Author

kubaflo commented Sep 10, 2024

After a chat with some folks, I think this is worth making into an actual feature. We already do this for Editor, so making this work the same for Entry is a better thing.

Could this PR be updated to rather be a .NET 9 feature that basically always adds the Done button to Entry - just like we have in Editor.

No problem, I will do it soon!

@kubaflo kubaflo changed the base branch from main to net9.0 September 11, 2024 00:00
@kubaflo kubaflo requested a review from mattleibow September 11, 2024 00:03
@kubaflo
Copy link
Contributor Author

kubaflo commented Sep 11, 2024

@mattleibow done :)

@mattleibow

This comment was marked as outdated.

This comment was marked as outdated.

@kubaflo kubaflo changed the title [net9.0][Enhancement][iOS] platform specific for entry's keyboard to have a done button [net9.0][Enhancement][iOS] Add a done button to entry Sep 13, 2024
@kubaflo kubaflo changed the base branch from net9.0 to main October 18, 2024 23:07
@jsuarezruiz

This comment was marked as outdated.

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Nov 18, 2024

/azp run

@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Aug 5, 2025
@PureWeen
Copy link
Member

PureWeen commented Aug 5, 2025

After a chat with some folks, I think this is worth making into an actual feature. We already do this for Editor, so making this work the same for Entry is a better thing.
Could this PR be updated to rather be a .NET 9 feature that basically always adds the Done button to Entry - just like we have in Editor.

Hm not sure who you talked to, but I'd love to discuss this a bit more. Adding a (visual) breaking change without a way to opt-out doesn't sound like a great thing to me.

It would make more sense to me to implement what we wanted to do originally here: make a platform-specific (or setting, if it is relevant to more platforms) that allows to customize this behavior for both the Entry and the Editor. Ideally with the setting set to true by default for the Editor since it's already on there and false for the Entry because we don't have it there today.

That way people can opt-in/out when they want but it doesn't change the default behavior of their apps today.

@mattleibow ?

@PureWeen
Copy link
Member

PureWeen commented Aug 6, 2025

/rebase

@Copilot Copilot AI review requested due to automatic review settings August 6, 2025 00:27
@github-actions github-actions bot force-pushed the done-button-entry branch from b3953c0 to d90f0bb Compare August 6, 2025 00:27
Copilot

This comment was marked as outdated.

@PureWeen PureWeen requested a review from Copilot August 6, 2025 00:29
@PureWeen
Copy link
Member

PureWeen commented Aug 6, 2025

/azp run

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a "Done" button to text fields and editors on iOS by implementing a reusable input accessory view. This addresses user experience issues where keyboards without dedicated "Done" buttons (such as Numeric, Plain, and Telephone keyboards) make it difficult for users to dismiss the keyboard, especially when tapping outside doesn't hide it.

  • Refactors existing editor "Done" button functionality into reusable extension methods
  • Adds "Done" button support to Entry controls (previously only available for Editor)
  • Creates consistent behavior across both Entry and Editor controls for keyboard dismissal

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Core/src/Platform/iOS/TextViewExtensions.cs Adds extension method to attach Done accessory view to UITextView with editor-specific completion handling
src/Core/src/Platform/iOS/TextFieldExtensions.cs Adds extension method to attach Done accessory view to UITextField with entry-specific completion handling
src/Core/src/Handlers/Entry/EntryHandler.iOS.cs Updates Entry handler to use new Done accessory view extension method
src/Core/src/Handlers/Editor/EditorHandler.iOS.cs Refactors existing Done button code to use new extension method
Comments suppressed due to low confidence (1)

src/Core/src/Platform/iOS/TextViewExtensions.cs:193

  • The variable name 'entryHandler' is misleading since this is in TextViewExtensions and handles IEditorHandler. It should be renamed to 'editorHandler' for clarity.
			if (sender is IEditorHandler entryHandler)

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

@kubaflo can you fix tests on this one and rebase?

@github-project-automation github-project-automation bot moved this from Ready To Review to Changes Requested in MAUI SDK Ongoing Aug 20, 2025
@kubaflo kubaflo force-pushed the done-button-entry branch from d90f0bb to f804c01 Compare August 20, 2025 23:32
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@kubaflo kubaflo force-pushed the done-button-entry branch from f804c01 to 7e1aa80 Compare August 23, 2025 17:59
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jfversluis jfversluis modified the milestones: .NET 9 SR12, .NET 9 SR11 Aug 27, 2025
@jfversluis jfversluis changed the base branch from main to inflight/current August 27, 2025 12:24
Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

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

Let's do this. We can always add a opt-in/opt-out for it later!

@jfversluis jfversluis merged commit e6f3c75 into dotnet:inflight/current Aug 27, 2025
127 of 129 checks passed
@github-project-automation github-project-automation bot moved this from Changes Requested to Done in MAUI SDK Ongoing Aug 27, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

Status: Done

7 participants