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

Make it easier to style a selected TreeView node that contains a custom razor component #3771

Closed
Jinjinov opened this issue May 7, 2022 · 0 comments
Labels
Status: Not Planned Type: Feature ⚙ Request or idea for a new feature.

Comments

@Jinjinov
Copy link
Contributor

Jinjinov commented May 7, 2022

Is your feature request related to a problem? Please describe.

Simple TreeView nodes like in https://github.com/Megabit/Blazorise/blob/master/Demos/Blazorise.Demo/Pages/Tests/TreeViewPage.razor#L20
can be styled easily.

But as soon as we add a complex element inside the <NodeContent> we get a graphical glitch on the selected node - two bars, one above and one below the component:

glitch

because _TreeViewNodeContent.razor.cs adds p-1 cursor-pointer bg-primary text-white

the only way to remove p-1 is to add SelectedNodeStyling="@((item, style) => { style.Style = "padding:0!important"; })"

fixed

Describe the solution you'd like

Make it easier to use a custom razor component inside a <NodeContent>.

Not everyone will figure out to add { style.Style = "padding:0!important"; }

Perhaps SelectedNodeClasses that override p-1 cursor-pointer bg-primary text-white ?

Additional context

SelectedNodeStyling is not documented: https://blazorise.com/docs/extensions/treeview

@Jinjinov Jinjinov added the Type: Feature ⚙ Request or idea for a new feature. label May 7, 2022
@stsrki stsrki closed this as completed Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Not Planned Type: Feature ⚙ Request or idea for a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants