nativescript-ui-feedback
nativescript-ui-feedback copied to clipboard
[FEATURE REQUEST] RadDataForm - New Field Properties
Would love to see properties added to disable auto capitalization and auto correct. TextFields support this, but it does not appear that this is supported in the RadDataForm's, unless I can't find it.
+1
+1
+1
+1
+1
+1 Just spent 3 hours to get this working with RadDataForm and no joy. It's critical for a user name since it is case sensitive. The fact that it's not possible with the data form is truly shocking.
+1 This is really needed.
I just wanted to post this in case it can help anyone. I'm using NativeScript 7 with Angular and TypeScript (but you can also just use regular JavaScript) and I got it working by accessing the native elements of iOS and Android used under RadDataForm
. I was also able to figure out the types for TypeScript which was really nice to see all the different InputType
's available*:
<RadDataForm [source]="item" (editorUpdate)="onEditorUpdate($event)">
<TKEntityProperty tkDataFormProperty name="description"></TKEntityProperty>
</RadDataForm>
import { DataFormEventData } from 'nativescript-ui-dataform';
import { ios } from '@nativescript/core/application';
// ... inside an Angular component
public onEditorUpdate(dataFormEvent: DataFormEventData): void {
if (dataFormEvent.propertyName === 'description') {
if (ios) {
const iosTextField = dataFormEvent.editor as UITextField;
iosTextField.autocapitalizationType = UITextAutocapitalizationType.Sentences; // "Sentences", "Words", "AllCharacters", or "None"
iosTextField.autocorrectionType = UITextAutocorrectionType.Yes; // "Yes", "No", or "Default"
} else {
const textEditor = dataFormEvent.editor as com.telerik.widget.dataform.visualization.editors.DataFormTextEditor;
const androidEditText = textEditor.getEditorView() as android.widget.EditText;
androidEditText.setInputType(android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES); // Many difference choices see Android docs: https://developer.android.com/reference/android/text/InputType
}
}
}
*Android InputType
choices, see Android docs: https://developer.android.com/reference/android/text/InputType
how to make this work with plain js N7?