TextInput multiline support
The multiline option does not work at all in my ios simulator (in fact the input is not editable with multiline).
The doc says :
The multiline prop is not supported in all release
Could we have more of information ? :)
Yeah sorry, we haven't ported that functionality to open source yet.
On Mar 26, 2015, at 4:38 PM, François de Campredon [email protected] wrote:
The multiline options does not work at all in my ios simulator (in fact the input is not editable with multiline={true}).
The doc says :
The multiline prop is not supported in all release Could we have more of information ? :)
— Reply to this email directly or view it on GitHub.
@sahrens Do you have an approximate time frame for when we can expect this feature? And thanks for all the hard work you and the React Native team have already done on this!
+1
Thanks for +1-ing issues like this, helps us prioritize. Unfortunately there is no estimate yet...
On Apr 3, 2015, at 12:03 PM, Jack Boyce [email protected] wrote:
+1
— Reply to this email directly or view it on GitHub.
+1 as well :) I got a version with minimal functionality working on my side, by creating a custom view/manager, might be useful in the interim.
#import "RCTViewManager.h"
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#import "UIView+React.h"
@class RCTEventDispatcher;
@interface RCTUITextView : UITextView<UITextViewDelegate>
- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;
@end
@implementation RCTUITextView
RCTEventDispatcher *_eventDispatcher;
- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
{
if ((self = [super initWithFrame:CGRectZero])) {
_eventDispatcher = eventDispatcher;
[self setDelegate:self];
}
return self;
}
- (void)textViewDidEndEditing:(UITextView *)textView
{
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd
reactTag:self.reactTag
text:self.text];
}
- (void)textViewDidChange:(UITextView *)textView
{
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange
reactTag:self.reactTag
text:self.text];
}
@end
@interface UITextViewManager : RCTViewManager
@end
@implementation UITextViewManager
- (UIView *)view
{
return [[RCTUITextView alloc] initWithEventDispatcher:self.bridge.eventDispatcher];
}
RCT_EXPORT_VIEW_PROPERTY(text, NSString)
@end
UITextView.js
'use strict'
var createReactIOSNativeComponentClass = require('createReactIOSNativeComponentClass');
module.exports = createReactIOSNativeComponentClass({
validAttributes: { text: true },
uiViewClassName: 'UITextView',
});
<UITextView onChange={(de) => console.log(de.nativeEvent.text)} onEndEditing={(de) => console.log("end: ",de.nativeEvent.text)}/>
+1
+1
:+1:
+1
This is now being tracked in #991 - mostly done, just fixing an existing TextInput bug that I encountered along the way.