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: alert text show up to 1000 #744

Merged
merged 1 commit into from
Dec 10, 2024
Merged

fix: alert text show up to 1000 #744

merged 1 commit into from
Dec 10, 2024

Conversation

tisfeng
Copy link
Owner

@tisfeng tisfeng commented Dec 8, 2024

Fix #742

@tisfeng
Copy link
Owner Author

tisfeng commented Dec 8, 2024

I tried adding ScrollView and limiting the number of frame and lines of Text, but nothing worked.

@Jerry23011
Copy link
Collaborator

GPT says alert's message view doens't have native support for scroll view, a workaround would be to use .sheet to define a custom view.

2024-12-08.13.57.48.mov

@tisfeng
Copy link
Owner Author

tisfeng commented Dec 9, 2024

I see, because alert can only display text-based information

On iOS, tvOS, and watchOS, alerts only support controls with labels that are Text. Passing any other type of view results in the content being omitted.

Only unstyled text is supported for the message.

It's true that a sheet can use a ScrollView, but the alert style is more appropriate here, and I don't want to spend the effort to modify the sheet into the alert style, it's too tiring.

There are only a few cases where an alert would cause an exception, if there is no better solution, let's simply truncate the text.

@Jerry23011
Copy link
Collaborator

It's true that a sheet can use a ScrollView, but the alert style is more appropriate here, and I don't want to spend the effort to modify the sheet into the alert style, it's too tiring.

There are only a few cases where an alert would cause an exception, if there is no better solution, let's simply truncate the text.

True true, let's keep it alert.

@tisfeng tisfeng merged commit 852c67e into dev Dec 10, 2024
5 checks passed
@tisfeng tisfeng deleted the fix-alert-text-too-long branch December 10, 2024 13:14
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.

2 participants