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

fix(ui): handle long text in BuilderSelect #706

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

madeindjs
Copy link
Collaborator

The BuilderSelect trigger has overflow issues with long text containing breakable content. The trick was just a missing white-space: nowrap rule.

I also took the opportunity to add a tooltip to the BuilderSelect's trigger.

Screenshot 2024-12-18 at 19 15 29

The `BuilderSelect` trigger has overflow issues with long text
containing breakable content. The trick was just a missing `white-space:
nowrap` rule.

I also took the opportunity to add a tooltip to the `BuilderSelect`'s
trigger.
@madeindjs madeindjs self-assigned this Dec 18, 2024
@FabienArcellier
Copy link
Collaborator

FabienArcellier commented Dec 26, 2024

I had this issue 2 weeks ago. It would be awesome to have the popup on the list after 3 seconds to know what is the handler. do you think it would be possible ?

image

@madeindjs
Copy link
Collaborator Author

Good point @FabienArcellier . I thought about it, it's easy as adding an attribute data-writer-tooltip on each option. The issue is, the tooltip will be displayed every time.

I would like to display the tooltip only if the element overflow. Maybe adding a new prop data-writer-tooltip-strategy="overflow".

I can give a try, it should not be that hard to implement this logic here

function handleMouseover(ev: MouseEvent) {
const el = ev.target as HTMLElement;
const tooltippedEl = el.closest("[data-writer-tooltip]") as HTMLElement;
if (!tooltippedEl) {

@madeindjs
Copy link
Collaborator Author

madeindjs commented Dec 26, 2024

@FabienArcellier , I implemented it 02e3ef0 . So we display the tooltip in BuilderSelect only if the element overflow

Screen.Recording.2024-12-26.at.10.54.57.mov

I introduce a new attribute `data-writer-tooltip-strategy` that define
when the tooltip should be display.

In `overflow` mode, we check that the element has wrapped text inside`.
@ramedina86 ramedina86 merged commit ada9bec into writer:dev Jan 7, 2025
16 checks passed
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

Successfully merging this pull request may close these issues.

3 participants