Ask Your Question
3

How can the keyboard type be specified for a RadAutocompleteTextView in Nativescript using Typescript?

asked 2022-03-03 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-10-15 00:00:00 +0000

ladyg gravatar image

To specify the keyboard type for a RadAutocompleteTextView in Nativescript using Typescript, you can use the "keyboardType" property. For example:

import { Component } from "@angular/core";
import { AutoCompleteEventData, AutoCompleteItem } from "nativescript-ui-autocomplete";
import { KeyboardType } from "tns-core-modules/ui/enums";

@Component({
    selector: "ns-app",
    templateUrl: "./app.component.html"
})
export class AppComponent {
    public items: Array<AutoCompleteItem> = [
        { suggestion: "Item 1" },
        { suggestion: "Item 2" },
        { suggestion: "Item 3" },
        { suggestion: "Item 4" },
        { suggestion: "Item 5" }
    ];

    public keyboardType: KeyboardType = "email";

    public onAutoCompleteEvent(event: AutoCompleteEventData) {
        console.log(event.eventName);
        console.log(event.object.text);
    }
}

In this example, the "keyboardType" property is set to "email", but other value options include "datetime", "phone", "url", and more. This property is then bound to the RadAutocompleteTextView to specify the keyboard type.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-03-03 11:00:00 +0000

Seen: 11 times

Last updated: Oct 15 '22