Adding 'NodeSelecting' event breaks single click selection in Blazor TreeView

Attaching the NodeSelecting event seems to affect the ability of the Blazor TreeView control to correctly determine which node is selected when single clicked.

Reproducing the issue:

Start 1) Start with the VisualStudio 2022 Blazor Server template and add the TreeView demo code.

Step 2) Add the TreeViewEvents tag as shown below:

    <SfTreeView TValue="TreeData" SortOrder="Syncfusion.Blazor.Navigations.SortOrder.None">
       <TreeViewFieldsSettings DataSource="@TreeDataSource" Id="Id" ParentID="Pid" Text="Name" HasChildren="HasChild" Expanded="Expanded" ></TreeViewFieldsSettings>
        <TreeViewEvents TValue="TreeData" NodeSelecting="NodeSelecting"></TreeViewEvents>
    </SfTreeView>


Step 3) Add the event handler as shown below:

    public void NodeSelecting(NodeSelectEventArgs args)

    {
        //
        // if the item is not a leaf, it should not be selected
        //
        if (args.NodeData.HasChildren)
            args.Cancel = true;
    }


Expected Behavior:

Single clicking any leaf node immediately selects the node.

Actual Behavior:

It initially looks like selecting a leaf node requires double clicking. However, if you randomly single click different nodes you'll see that the actually selected node lags the single click selection.

Attachments:

I've attached sample code and a video of the issue.



Does anyone have a way to work around this bug?

Thanks!
Jerrill


Attachment: SyncfusionBlazorApp1_addd4c90.zip

4 Replies

JE Jerrill August 23, 2022 01:25 AM UTC

Video didn't upload previously. Zipped and re-uploaded below.


Attachment: video_c50356e8.zip


PM Prasanth Madhaiyan Syncfusion Team August 23, 2022 12:20 PM UTC

Hi Jerrill,


Greetings from Syncfusion support.


We have validated the reported query in the Blazor TreeView component and considered it as a bug at our end. The fix for this issue will be included in our weekly patch release on September 13, 2022. You can track the status of the issue fix using the following feedback link.


Feedback link: https://www.syncfusion.com/feedback/37228/the-node-selection-behavior-is-not-proper-while-using-the-nodeselecting-event-in


Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.


We appreciate your patience.


Regards,

Prasanth Madhaiyan.



IL Indhumathy Loganathan Syncfusion Team September 14, 2022 10:55 AM UTC

Hi Jerrill,


Sorry for the inconvenience.


Due to high priority features and bug fixes, we were unable to include the fix as promised. The fix for this issue will be included in our first weekly patch release on October, 2022. We appreciate your patience.


Regards,

Indhumathy L



LD LeoLavanya Dhanaraj Syncfusion Team October 4, 2022 01:18 PM UTC

Hi Jerrill,


We are glad to announce that our Essential Studio 2022 Volume 3 release v20.3.0.47 is rolled out and is available for download under the following link.


https://www.syncfusion.com/forums/177858/essential-studio-2022-volume-3-main-release-v20-3-0-47-is-available-for-download


The issue with “The node selection behavior is not proper while using the NodeSelecting event in the Blazor TreeView component” has been resolved in this release. To access this fix, we suggest you update the package to 20.3.47. But the release notes are not refreshed in our documentation, but it will be refreshed any of our upcoming releases.


Please find the sample from below link.


Feedback : https://www.syncfusion.com/feedback/37228/the-node-selection-behavior-is-not-proper-while-using-the-nodeselecting-event-in


Release notes : https://blazor.syncfusion.com/documentation/release-notes/20.3.47?type=all


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/SfTreeView753050267.zip


Please let us know if you need any further assistance.


Regards,

Leo Lavanya Dhanaraj


Loader.
Up arrow icon