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

Tooltip on Table Column header label #33

Open
skochev84 opened this issue Oct 13, 2023 · 5 comments
Open

Tooltip on Table Column header label #33

skochev84 opened this issue Oct 13, 2023 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@skochev84
Copy link

Is there a way to set a tooltip when hovering over a label of a table column? Right now I can only set a String for the label like this:

   <TableColumn<Columns> label="Id" index={Columns::Id}/>

And I want to send a VNode. Something like this:

   <TableColumn<Columns> label=html!(
       <Tooltip text="This is just an example tooltip.">
           "Id"
      </Tooltip>)
      index={Columns::Id}/>

Or any other way to add a tooltip?

@ctron
Copy link
Member

ctron commented Oct 14, 2023

I agree, it would be a good enhancement to replace this with e.g. Html. Maybe this requires some custom type (newtype of Html), so that it is possible to assign from a string, as well as html!.

@ctron ctron added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 14, 2023
@skochev84
Copy link
Author

There are probably other places where there's a string which can be refactored to accept html.

@ctron
Copy link
Member

ctron commented Oct 16, 2023

Probably, but even fixing one location is good enough.

@skochev84
Copy link
Author

skochev84 commented Oct 19, 2023

I see now that for Tab component is working as above:

`
<Tabs detached=true {onselect} selected={*selected} r#box=true>

                <Tab<TabIndex> index={TabIndex::Foo} title="Foo"/>

                <Tab<TabIndex> index={TabIndex::Bar} title="Bar"/>

                <Tab<TabIndex> index={TabIndex::Baz} title={html!(<>{"Baz "} <Badge>{"42"}</Badge></>)}/>

            </Tabs<TabIndex>>`

The title here can be html or just a string. Maybe do it the same way for the label on the columns in the grid component and other places.

@ctron
Copy link
Member

ctron commented Oct 19, 2023

Yes! Maybe pull this out to make it more generic. But I think this is the API to offer to the user/developer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants