Repository navigation
Conversation
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requires livewire/flux-pro#607. Merge and release that first. Without it, hovering a disabled button or toggle no longer shows its tooltip.
The scenario
Wrapping a progress bar in a tooltip makes the bar disappear. Inputs, selects, cards and
w-fullbuttons with atooltipprop shrink to their content.The problem
Since #2746,
ui-tooltipisdisplay: inline-flex, so it shrinks to fit its content, and a full-width child sizes itself from that shrunken width.flux:progressisw-fulland has no content, so it answers "0".Components with content, like inputs, selects and cards, don't disappear. They shrink to their content instead.
with-tooltipadds the sameinline-flex(#2743), so<flux:button tooltip="…" class="w-full">doesn't fill its row.That box was only added so disabled triggers have something under the pointer. A disabled button has
pointer-events: none, so the pointer falls through it to the tooltip.The solution
ui-tooltipdoesn't render a box anymore, so its children lay out as if it weren't there:with-tooltipno longer addsinline-flex.The JS side (livewire/flux-pro#607) no longer needs that box:
This also fixes
<flux:tooltip><flux:toggle /></flux:tooltip>, whose tooltip was positioned at the top-left of the page and whosearia-describedbylanded on the<flux:accent>wrapper:Flux's own usages:
flux:avatar.groupoverlaps avatars with*:not-first:-ml-2. A margin on the tooltip has no effect anymore, so the avatar inside a tooltip gets it instead.flux:sidebar.searchputw-fullon its tooltip. That no longer does anything, and the button inside is alreadyw-full, so it's removed.flux:sidebar.itemkeepsclass="block"on its tooltip, so it's unchanged.class="contents", so it's unchanged.I compared the sidebar (expanded and collapsed), button groups, input groups, avatars, toggles, the editor toolbar and calendars before and after. They matched, with one exception. An icon button with a tooltip inside
flux:input.groupnow shrinks a few pixels like the same button without a tooltip does (40px → ~36px in a 320px group). Before this change, the tooltip's box stopped it from shrinking.Breaking change
Classes on
<flux:tooltip>that rely on it having a box no longer apply unless you also add a display class. Examples are margins, padding,w-full,flex-1and positioning. Display classes likeclass="block"still give it a box and work as before.Fixes #2849