3

In field email:

<TKEntityProperty v-tkDataFormProperty name="email" displayName imageResource="res://user" hintText="Email" index="0">
  <TKPropertyEditor v-tkEntityPropertyEditor type="Email">
    <TKPropertyEditorStyle v-tkPropertyEditorStyle labelWidth="4" />
  </TKPropertyEditor>
  <TKEmailValidator v-tkEntityPropertyValidators errorMessage="Invalid email"></TKEmailValidator>
</TKEntityProperty>

Can set autocapitalizationType="none" in RadDataForm on Nativescript?

Narendra
  • 4,514
  • 2
  • 21
  • 38
snakom23
  • 199
  • 3
  • 13

2 Answers2

1

As of today it's an open feature request, you might want to upvote the issue and follow up there.

Still you can access the native editor object and turn off auto capitalization.

<template>
    <Page class="page">
        <ActionBar title="Home" class="action-bar" />
        <RadDataForm :source="person" @editorUpdate="onEditorUpdate">
            <TKEntityProperty v-tkDataFormProperty name="email">
                <TKPropertyEditor v-tkEntityPropertyEditor type="Email">
                    <TKPropertyEditorStyle v-tkPropertyEditorStyle />
                </TKPropertyEditor>
            </TKEntityProperty>
        </RadDataForm>
    </Page>
</template>

<script>
    import Vue from "nativescript-vue";
    import RadDataForm from "nativescript-ui-dataform/vue";
    Vue.use(RadDataForm);

    import * as application from "tns-core-modules/application";

    export default {
        data() {
            return {
                person: {
                    email: ""
                }
            };
        },
        methods: {
            onEditorUpdate: function(args) {
                if (args.propertyName === "email") {
                    if (application.ios) {
                        args.editor.editor.autocapitalizationType =
                            UITextAutocapitalizationType.None;
                    }
                }
            }
        }
    };
</script>

Playground Sample

I believe your issue should be only with iOS, on Android by default its lower case.

Manoj
  • 21,753
  • 3
  • 20
  • 41
0

I just wanted to post an answer that also shows how to change the keyboard for both Android and iOS in case it helps 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 === 'descriptionProperty') {
      if (ios) {
        const iosTextField = dataFormEvent.editor as UITextField;
        iosTextField.autocapitalizationType = UITextAutocapitalizationType.None;  // "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_VARIATION_NORMAL);  // 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

RcoderNY
  • 1,204
  • 2
  • 16
  • 23