Placeholder bug in ASEditableTextNode

When setting a default placeholder and an attributedString before `_textKitComponents.textView` was created, the placeholder and the string were both appearing in the text node.

`_updateDisplayingPlaceholder` is called in `setAttributedString`, but since  `_textKitComponents.textView` is nil the placeholder was not hidden. Calling `_updateDisplayingPlaceholder` after `_textKitComponents.textView` loads fixes this.
This commit is contained in:
rcancro 2015-09-23 16:11:46 -07:00
parent 903498c924
commit 52091eb589

View File

@ -143,6 +143,7 @@
_textKitComponents.textView.accessibilityHint = _placeholderTextKitComponents.textStorage.string; _textKitComponents.textView.accessibilityHint = _placeholderTextKitComponents.textStorage.string;
configureTextView(_textKitComponents.textView); configureTextView(_textKitComponents.textView);
[self.view addSubview:_textKitComponents.textView]; [self.view addSubview:_textKitComponents.textView];
[self _updateDisplayingPlaceholder];
} }
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize