- DominikRuta
- Posts: 7
- Joined:
[UE5] Double-click needed to select item in Listbox. Single-click does not work.
Hello, I have the following Listbox control with some items, where after I select item, I want it to be visually visible.
Selecting the item worked as expected on first left button click, but after latest Noesis update 3.2.4, I have to double click in order to select the item. Right-click works fine. I've noticed that UNoesisInstance::NativeOnMouseButtonUp triggers only after the second click, not the first click. We are using FInputModeGameAndUI input mode and for instance casual buttons or items in ItemsControl works fine on the first click. If I switch to FInputModeUIOnly it works fine, but majority of the other UI stuff don't, so its no-go for me.
Any idea what could be wrong here?
Code: Select all
<ListBox>
<ListBoxItem>Item 1</ListBoxItem>
<ListBoxItem>Item 2</ListBoxItem>
<ListBoxItem>Item 3</ListBoxItem>
<ListBoxItem>Item 4</ListBoxItem>
<ListBox.Style>
<Style TargetType="{x:Type ListBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border Background="{StaticResource TransparentWhite}">
<ItemsPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Style>
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Foreground" Value="Red" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border Background="{StaticResource TransparentWhite}">
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid Background="Green" Margin="5" Focusable="False">
<TextBlock Focusable="False" Text="{Binding}" Style="{StaticResource Style.Text.T1}" Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}" />
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Yellow" />
</Trigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
Any idea what could be wrong here?
Re: [UE5] Double-click needed to select item in Listbox. Single-click does not work.
Hello,
I think this may be related to a know issue introduced in Noesis SDK 3.2.4. Could you please create a ticket on our bug tracker and paste the link, so I can send you a patch?
Thank you!
I think this may be related to a know issue introduced in Noesis SDK 3.2.4. Could you please create a ticket on our bug tracker and paste the link, so I can send you a patch?
Thank you!
Re: [UE5] Double-click needed to select item in Listbox. Single-click does not work.
Just as a simple contribution, since Xamltoy is still working with Noesis 3.1, I've pasted the code above there, and everything worked fine as well — after some cleaning of resources, but nevermind.
- DominikRuta
- Posts: 7
- Joined:
Re: [UE5] Double-click needed to select item in Listbox. Single-click does not work.
I've fixed the issue by applying your revision 14284.
Re: [UE5] Double-click needed to select item in Listbox. Single-click does not work.
That was the change I was referring to, glad it solved you issue, and sorry I didn't get back to you earlier.
- DominikRuta
- Posts: 7
- Joined:
Re: [UE5] Double-click needed to select item in Listbox. Single-click does not work.
It solved the issue. However, unfortunately, It introduced another problem. There is an issue when switching from mouse to gamepad controller while having open some screen with list. It looks like the focus is lost from the entire screen and I can't navigate through the list using d-pads. It seems that core of the problem are UNoesisInstance::NativeOnMouseEnter and UNoesisInstance::NativeOnMouseLeave. If I revert changes in these functions, double-click issue is back again, but the problem with the focus is gone and vice-versa.
Re: [UE5] Double-click needed to select item in Listbox. Single-click does not work.
Have you set SetUserFocusToViewport to true? You probably don't need that. When true, it gives focus to the game Viewport. It's there for a very specific use case.
If you haven't set it to true, could you please update the ticket with repro steps?
Thanks!
If you haven't set it to true, could you please update the ticket with repro steps?
Thanks!
- DominikRuta
- Posts: 7
- Joined:
Re: [UE5] Double-click needed to select item in Listbox. Single-click does not work.
I've updated the ticket. Again, we tried to fix the issue and came up with the "temporal" solution to deal with both issues. After using the above mentioned revision, we then updated Noesisinstance.ccp:
- Reverting UNoesisInstance::NativeOnMouseEnter and UNoesisInstance::NativeOnMouseLeave overrides
- In UNoesisInstance::NativeOnMouseButtonDown we changed "if (Handled && Hit)" condition to "if (Hit)"
Re: [UE5] Double-click needed to select item in Listbox. Single-click does not work.
There's an additional change for the SDK at revision 14337, that affects the behavior of ListBoxItems. Could you try that change along with the plugin code without modification?
Thanks!
Thanks!
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests