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: Use custom label for CompatibilityContentUnavailableView #4647

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

facumenzella
Copy link
Contributor

@facumenzella facumenzella commented Jan 10, 2025

Motivation

This PR tries to address #4638.

Before After
IMG_7180 IMG_7179

Description

For some reason, ContentUnavailableView truncates the label. I've tried using lineLimit(nil) over the Label, but that didn't work. This seems to do the trick.

fixedSize(vertical:true) forces the view to grow vertically to the needed height.

@facumenzella facumenzella added the pr:fix A bug fix label Jan 10, 2025
Copy link
Member

@aboedo aboedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! It does mean we have a liiitle more vertical padding now (see the screenshots) but it doesn't look wrong to my eye

@aboedo
Copy link
Member

aboedo commented Jan 10, 2025

(approved but we should fix the linting + approve the new snapshots before merging)

@facumenzella facumenzella changed the title fix: Custom label for CompatibilityContentUnavailableView fix: Use custom label for CompatibilityContentUnavailableView Jan 13, 2025
} icon: {
iconView
}
}
Copy link

@ajpallares ajpallares Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious 🤔. Would it be possible to remove the if let description and keep only this?

ContentUnavailableView {
    Label {
        titleView
    } icon: {
        iconView
    }
}
description: { description }

I don't know if nil would have the same effect as EmptyView() (which is the default value for the description parameter when the parameter is not included)

@facumenzella facumenzella merged commit 70b0791 into main Jan 13, 2025
10 checks passed
@facumenzella facumenzella deleted the fix/accessibility branch January 13, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants