xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

Border brush color not working properly for PointerEntered event in UWP TextBox #5597

Open KarthikRajaAKR opened 5 years ago

KarthikRajaAKR commented 5 years ago

Description

I have used TextBox in native UWP view. I changed the Border brush color initially it's not working. I tried to change border brush color dynamically when PointerEntered event raised but color was not changed as I mapped. Notably PointerExited event color mapping working fine.

In my sample I have used Custom renderer and added two TextBox items in stack panel and rendered that stack panel as native view. No changes were made in first textbox item. Changed BorderBrush color for second item.

Steps to Reproduce

  1. Run the attached BorderBrush_Sample in UWP platform.
  2. Don't change focus to second item. Just move the pointer inside second TextBox item. note color remains as Gray (Mapped color was Yellow). Remove pointer from TextBoxItem border will be in blue.
  3. Now change focus to Second TextBox. PointerEntered and Exited colors working fine.

Expected Behavior

Border Brush color should be given color for PointerEntered event both Focused and UnFocused states.

Actual Behavior

Dynamic color changes were not happen properly for Border brush.

Basic Information

Screenshots

Initial Loading

image

Border Brush color at Unfocused and PointerEntered state image

Border Brush color at Focused and PointerEntered state image

Reproduction Link

BorderBrush_Sample.zip

KarthikRajaAKR commented 5 years ago

Any update on this?

KarthikRajaAKR commented 5 years ago

Hi @samhouts please let me know, Is this a bug or it can be achievable in sample level? I need this in high priority.

KarthikRajaAKR commented 5 years ago

Please provide me a solution

AjitKRuin commented 5 years ago

Hi @samhouts ,me too facing the same issue, the BorderBrush color is not changing as we expected when it is not focused but cursor is entered into it.

KarthikRajaAKR commented 5 years ago

Hi @samhouts could you please update details of this issue?

samhouts commented 5 years ago

This is still on the backlog. Thank you for your patience!

KarthikRajaAKR commented 5 years ago

Hi Team,

Any update on this.

WayaFlyfeather commented 4 years ago

@KarthikRajaAKR Hi, I looked at your issue, but I'm not sure this really has anything to do with Xamarin Forms?

As far as I can tell, you are making a custom control, that includes two UWP text boxes. And you are setting the native BorderBrush on the second native TextBox in a native event - and this doesn't work as expected?

I don't think this is really related to Xamarin Forms, it's a UWP thing, as far as I can tell.

Also, I wouldn't be certain how BorderBrush is expected to work on a TextBox (it varies, see this link); it may very well be it works as expected, and is only (by default) supposed to be applied when a TextBox has focus. The usual approach for specifying this in UWP would be to apply a style, that sets the color depending on the ViewState of the TextBox - i.e, if it is focused or has PointerOver, etc.

See this SO-reply for an example of setting the Pointer Over visual state.

I hope this may help — and I apologize if I misunderstand your issue.

ID-GO commented 4 years ago

Whats the Update on This