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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: OnClick does not fire when using FluentDataGrid.OnRowFocus #1722

Closed
kambet1 opened this issue Mar 20, 2024 · 4 comments
Closed

fix: OnClick does not fire when using FluentDataGrid.OnRowFocus #1722

kambet1 opened this issue Mar 20, 2024 · 4 comments

Comments

@kambet1
Copy link

kambet1 commented Mar 20, 2024

馃悰 Bug Report

When using FluentDataGrid's OnRowFocus, OnClick inside a TemplateColumn does not fire in certain situations.
This sample code uses FluentStack, but you can create your own Razor component and get the same results.

馃捇 Repro or Code Sample

<FluentDataGrid Items="@("12".AsQueryable())"
                OnRowFocus="(FluentDataGridRow<char> p) => a = p.Item">
    <TemplateColumn>
        <FluentButton OnClick="_ => b = context">
            Button@(context)
        </FluentButton>
    </TemplateColumn>
</FluentDataGrid>
<FluentStack Orientation="Orientation.Vertical">
    <FluentDataGrid Items="@("34".AsQueryable())"
                    OnRowFocus="(FluentDataGridRow<char> p) => a = p.Item">
        <TemplateColumn>
            <FluentButton OnClick="_ => b = context">
                Button@(context)
            </FluentButton>
        </TemplateColumn>
    </FluentDataGrid>
    <FluentStack>
        <FluentDataGrid Items="@("56".AsQueryable())"
                        OnRowFocus="(FluentDataGridRow<char> p) => a = p.Item">
            <TemplateColumn>
                <FluentButton OnClick="_ => b = context">
                    Button@(context)
                </FluentButton>
            </TemplateColumn>
        </FluentDataGrid>
    </FluentStack>
</FluentStack>
OnRowFocus: @a<br/>ButtonClick: @b

@code {
    char a = '0';
    char b = '0';
}

馃 Expected Behavior

OnClick is executed no matter which button is pressed, and OnRowFocus and ButtonClick display the same value.

馃槸 Current Behavior

OnClick is not executed for Button5 and Button6 on FluentDataGrid, two levels below, so only the display of OnRowFocus is updated.

馃實 Your Environment

OS & Device: Windows 10
Browser: Google Chrome
Fluent UI: 4.5.0

@vnbaaij
Copy link
Collaborator

vnbaaij commented Mar 20, 2024

No idea why this is happening.

It does not have to do with the OnRowFocus. When setting breakpoints in the generated script, you can see both OnRowFocus and OnCellFocus get called and handeled.

@kambet1
Copy link
Author

kambet1 commented Mar 21, 2024

Thank you for your prompt reply.
This problem does not occur unless you handle OnRowFocus.
Also, a problem occurs when nesting two Nothingness.razor components like the one below, so I imagine that there is some kind of cause on the Blazor side.

@this.ChildContent
@code {
    [Parameter]
    public RenderFragment? ChildContent { get; set; }
}

<Nothingness><Nothingness><FlulentDataGrid>...

@vnbaaij
Copy link
Collaborator

vnbaaij commented Apr 23, 2024

I am not going to investigate this further. The issue is there but to me it is a bit of an edge case. We do not have capacoty to get this solved.

@vnbaaij vnbaaij closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2024
@aDisplayName
Copy link

This happens to 4.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants