Skip to content

Conversation

@NirmalKumarYuvaraj
Copy link
Contributor

@NirmalKumarYuvaraj NirmalKumarYuvaraj commented Dec 5, 2024

Issue Details

User can input text when keyboard is open in picker.

Root Cause

The base view for the picker in the unfocused state is AppCompatEditText. It allows the user to edit using keyboard.

Description of Change

Setting the e.Handled to true in the KeyPress will prevent from further processing of the keys.

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #24930
Fixes #8265

Output

Before After
Before.mov
After.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Dec 5, 2024
@dotnet-policy-service
Copy link
Contributor

Hey there @NirmalKumarYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 5, 2024
@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review December 5, 2024 15:28
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner December 5, 2024 15:28
@Redth
Copy link
Member

Redth commented Dec 5, 2024

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho
Copy link
Member

rmarinho commented Dec 7, 2024

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@codeinapt

This comment was marked as off-topic.

@s-beji

This comment was marked as off-topic.

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.

  1. if we make these changes I think they should be moved here

    public static void Init(EditText editText)

  2. From looking at PickerManager it doesn't look like we want to completely disable the keyboard

@NirmalKumarYuvaraj
Copy link
Contributor Author

NirmalKumarYuvaraj commented Feb 20, 2025

  1. if we make these changes I think they should be moved here
    public static void Init(EditText editText)
  2. From looking at PickerManager it doesn't look like we want to completely disable the keyboard

@PureWeen , I have modified the code changes. please let me know if you have any concerns.

@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

static void OnKeyPress(object? sender, AView.KeyEventArgs e)
{
//To prevent user from entering text when focus is received
e.Handled = true;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we'll want to handle every single keypress event.

This will probably break scenarios where a user has a hardware keyboard connected to the device and is trying to use tab to navigate components

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PureWeen , Pressing the Tab key focuses on the EditText, causing the picker dialog to open. Navigation does not occur between the components. According to the implementation, a change in focus triggers the dialog to appear on the view. I have shared a video for reference. please let me know if you have any concerns.

Screen.Recording.2025-03-11.at.5.33.22.PM.mov

@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Apr 18, 2025
@PureWeen PureWeen modified the milestones: .NET 9 SR7, .NET 9 SR8 May 8, 2025
@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mattleibow mattleibow moved this from Ready To Review to Approved in MAUI SDK Ongoing May 23, 2025
@mattleibow mattleibow dismissed stale reviews from jsuarezruiz and PureWeen May 23, 2025 11:51

Code changes made.

@rmarinho rmarinho merged commit 228b7bf into dotnet:main May 28, 2025
129 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing May 28, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-picker Picker community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

The picker allows you to write text if the keyboard is visible Android Picker Issue (User can input text)