Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug][iOS] Editor placeholder doesn't wrap #12062

Open
rickclephas opened this issue Sep 9, 2020 · 0 comments
Open

[Bug][iOS] Editor placeholder doesn't wrap #12062

rickclephas opened this issue Sep 9, 2020 · 0 comments

Comments

@rickclephas
Copy link

Description

The editor placeholder doesn't wrap when the text doesn't fit on a single line.
#9710 fixed the wrap issue but caused #11889 which was fixed in #11891.
Unfortunately now the wrapping is broken again.

Steps to Reproduce

  1. Set a long placeholder on an editor
  2. Start scrolling horizontally

Expected Behavior

The placeholder text wraps to a second line if it doesn't fit.

Actual Behavior

The editor starts to scroll horizontally.

Basic Information

  • Version with issue: 4.8.0.1364
  • Last known good version: unknown
  • Affected Devices: all

Workaround

In a custom render we find the placeholder label:

var placeholderLabel = Control.Subviews.FirstOrDefault(view => view is UILabel);
if (placeholderLabel == null) return;

And add the following constraint to prevent the label from growing:

var widthConstraint = NSLayoutConstraint.Create(placeholderLabel, NSLayoutAttribute.Width, NSLayoutRelation.LessThanOrEqual, this, NSLayoutAttribute.Width, 1, TextView.TextContainer.LineFragmentPadding * -2);
AddConstraint(widthConstraint);
@rickclephas rickclephas added s/unverified New report that has yet to be verified t/bug 🐛 labels Sep 9, 2020
@StephaneDelcroix StephaneDelcroix added p/iOS 🍎 and removed s/unverified New report that has yet to be verified labels Sep 10, 2020
@samhouts samhouts added this to the 5.0.0 milestone Sep 15, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants