Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Feb 13, 2024

Description of Change

Added DatePicker Focus and Unfocus events

Issues Fixed

Fixes #18797

Demo
Screen.Recording.2024-02-13.at.14.23.34.mov

@kubaflo kubaflo requested a review from a team as a code owner February 13, 2024 13:25
@ghost ghost added the community ✨ Community Contribution label Feb 13, 2024
@ghost
Copy link

ghost commented Feb 13, 2024

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

@jsuarezruiz jsuarezruiz added the area-controls-datetimepicker DatePicker, TimePicker label Feb 13, 2024
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Feb 13, 2024
@jsuarezruiz jsuarezruiz added platform/android and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor labels Feb 13, 2024
@jsuarezruiz jsuarezruiz requested review from PureWeen and removed request for jsuarezruiz February 13, 2024 14:48
@jsuarezruiz
Copy link
Contributor

If we apply these changes, we should apply them to the TimePicker.

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Could replicate the same changes in the TimePicker?

@kubaflo
Copy link
Contributor Author

kubaflo commented Feb 22, 2024

@jsuarezruiz sure! I've added a commit with this

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Feb 29, 2024
@kubaflo kubaflo force-pushed the android-date-picker-focus-unfocus-events-added branch from 8841303 to 0625df0 Compare March 5, 2024 19:36
jonathanpeppers
jonathanpeppers previously approved these changes Mar 5, 2024
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

Changes LGTM now. 👍

We should check the new test passed when CI is done.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mos379
Copy link
Contributor

mos379 commented Apr 30, 2024

@PureWeen @tj-devel709 how about reviewing this?

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@pmigliore
Copy link

Hi, me and my team are migrating our Xamarin app to MAUI, and we need this feature to move forward, if anyone could take a look at this PR, thanks

@jsuarezruiz
Copy link
Contributor

/azp run

@danbrannanavontus
Copy link

Hi - as I understand it this fix hasn't made it into the release due to a merge issue. Would it be possible to get this looked at as this issue is causing a headache for us. Thanks

Dan

@brinawebb
Copy link

Hello Maui team. Is there any way this merge can be reviewed/approved? We are trying to convert our mobile project from Xamarin and this issue is preventing us from doing so. Should be a simple approval. Thank you!

@ryanaw83
Copy link

This fix is needed... will it be merged soon?

@PureWeen
Copy link
Member

PureWeen commented Sep 7, 2024

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mos379
Copy link
Contributor

mos379 commented Nov 15, 2024

@kubaflo nice!

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@kubaflo kubaflo force-pushed the android-date-picker-focus-unfocus-events-added branch from 6ab422d to 74b20c7 Compare March 2, 2025 00:00
@kubaflo kubaflo force-pushed the android-date-picker-focus-unfocus-events-added branch from 74b20c7 to b5e571f Compare March 8, 2025 01:25
@kubaflo kubaflo self-assigned this Mar 8, 2025
@bhavanesh2001
Copy link
Contributor

@PureWeen Just to confirm — based on this #28122 (comment), does this mean the PR won’t be moving forward?

@mattleibow
Copy link
Member

@PureWeen Just to confirm — based on this #28122 (comment), does this mean the PR won’t be moving forward?

I think the PRs are different. The other one did this:

PlatformView?.ClearFocus();

It actually changed the focus on the control.

This PR just updates the state in the virtual/xaml view so we get events.

However, this does still mean we need to verify that it does not cause issues. @PureWeen did you have an actual physical keyboard (on the desk) or is there a "virtual physical" keyboard that we can use to test?

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.

I am approving this with regards to code and logic and how things "should" work. However, it would be great to get someone with a physical keyboard on their phone to confirm that it does not crash the app or have some focus loops.

@mattleibow
Copy link
Member

/rebase

@github-actions github-actions bot force-pushed the android-date-picker-focus-unfocus-events-added branch from b5e571f to 344f3ef Compare May 30, 2025 23:25
@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@bhavanesh2001 bhavanesh2001 left a comment

Choose a reason for hiding this comment

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

The control isn’t a true platform input — it's a mix of AppCompatEditText and a dialog. Since nothing is actually focused at the platform level when the dialog is shown, mapping IsFocused to dialog show/dismiss is misleading.

In the case of Picker, a lot of custom wiring was done (like making EditText focusable on touch) just to make focus/unfocus work — which ended up causing subtle bugs: #29068 (comment)

Just wanted to flag this, With #29323 shaping up for .NET 10, might be worth aligning with that direction.

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.

pausing based on this comment

#20547 (review)

Do we still need this PR since we are adding APIS in NET10 for opening and closing pickers?

@PureWeen
Copy link
Member

Closing this in favor of APIs we're adding into .NET 10
#29323

@PureWeen PureWeen closed this Jun 20, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-datetimepicker DatePicker, TimePicker community ✨ Community Contribution platform/android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datepicker focus and unfocus event not firing on android