[UE5] Double-click needed to select item in Listbox. Single-click does not work.
Posted: 01 Oct 2024, 12:47
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?