Skip to content

Conversation

bring-shrubbery
Copy link
Member

@bring-shrubbery bring-shrubbery commented Aug 2, 2021

Notes

Closes #11. Thanks @chrysb for the issue.

Problem

The content was overflowing if you set the .frame of the element you attach tooltip to too small.

Solution

  • Added .fixedSize to content inside of ViewModifier

Screenshots

Code used for screenshots below

Circle() .fill(Color.green) .frame(width: 36, height: 36) .tooltip(.top) { Text("Tap here") }

Before fix

before

After fix

after

@bring-shrubbery bring-shrubbery added the bug Something isn't working label Aug 2, 2021
@bring-shrubbery bring-shrubbery self-assigned this Aug 2, 2021
@bring-shrubbery bring-shrubbery merged commit 930d941 into main Aug 2, 2021
@bring-shrubbery bring-shrubbery deleted the feature/automatically-sized-content branch August 2, 2021 14:20
@chrysb
Copy link

chrysb commented Aug 2, 2021

Did you try this with longer strings? I think it won't wrap anymore when you use .fixedSize()

@bring-shrubbery
Copy link
Member Author

@chrysb Could you provide a screenshot of how it looks for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants