Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListBoxAssist.IsToggle #3188

Closed
jbooth88 opened this issue May 10, 2023 · 1 comment · Fixed by #3208
Closed

ListBoxAssist.IsToggle #3188

jbooth88 opened this issue May 10, 2023 · 1 comment · Fixed by #3208
Labels
Milestone

Comments

@jbooth88
Copy link

Bug explanation

When ListBoxAssist.IsToggle=True, clicking on a list box item while a text box has focus, the LostFocus event will not trigger. Setting ListBoxAssist.IsToggle=False will trigger the LostFocus event as expected, when clicking on another item in the list.

This is a problem because when the focused text box UpdateSourceTrigger=LostFocus, the datacontext changes without updating the source, and any changes made by the user are lost.

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="144" />
        <ColumnDefinition />
    </Grid.ColumnDefinitions>

    <ListBox 
        Grid.Column="0" 
        ItemsSource="{Binding Items, Mode=OneTime}" 
        SelectedItem="{Binding SelectedItem, Mode=TwoWay}"         
        wpf:ListBoxAssist.IsToggle="True"
        Style="{DynamicResource MaterialDesignListBox}"
        />

    <Grid Grid.Column="1" DataContext="{Binding SelectedItem, Mode=OneWay}">
        <TextBox
            md:HintAssist.Hint="Test"
            Text="{Binding BoundProperty, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
            Style="{DynamicResource MaterialDesignFloatingHintTextBox}" 
            />
    </Grid>
</Grid>

Version

4.8.0

@jbooth88 jbooth88 added bug evaluation required Items is pending review or evaluation by the team labels May 10, 2023
@nicolaihenriksen nicolaihenriksen removed the evaluation required Items is pending review or evaluation by the team label May 11, 2023
@nicolaihenriksen
Copy link
Contributor

@jbooth88 You are correct that there is an issue in this area. I believe my comment here can provide input on what is needed to fix it. Feel free to open up a PR with the fix if you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
3 participants