When viewed on a mobile device, the page defaults to displaying the NumPad instead of the Text Keyboard in Angular

The email field in my angular app is opening a Key Pad in mobile view and I'm not sure why.

<form (ngSubmit)="onSubmit()" #emailForm="ngForm">
            <div class="emailaddress" style="text-align:center;" *ngIf="!showEmail">
                <div style="font-size: 20px; display: inline-block;">
                    My email address is:
                </div>   
                <div style="display: inline-block;">
                    <label for="emailAddress" class="visually-hidden">My email address is</label>
                    <input name="emailAddress" id="emailAddress" type="tel" maxlength="50" placeholder="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f380929e839f96b3969e929a9a9fdd909c9e">[email protected]</a>" [(ngModel)]="emailClass.emailAddress" pattern="([A-Za-z0-9-!#$%&_+`{}|']+)?(\.[A-Za-z0-9-!#$%&_+`{}|']+)*@[A-Za-z0-9-]+\.([A-Za-z0-9]{2,})+" aria-required="true" required/>
                </div>
                <div style="margin-bottom: 0px; margin-top: 20px;" class="error-generic" *ngIf="emailForm.touched && (emailForm.form.controls['emailAddress'].invalid && emailForm.form.controls['emailAddress'].touched)">
                    <svg height="32" viewBox="0 0 32 32" width="32"><path d="..." fill="#6d6e71"></path></svg>
                        Correct the email field to continue.
                </div>
                <div style="margin-top: 20px;">
                    <button id="email-me" class="button large" [disabled]="!emailForm.form.valid">Send Email</button>
                </div>
            </div>
        </form>

Answer №1

To adjust the input, switch the type to "email".

<input name="emailAddress" id="emailAddress" type="email" maxlength="50" placeholder="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="90e3f1fde0fcf5d0f5fdf1f9fcbef3fffd">[email protected]</a>" [(ngModel)]="emailClass.emailAddress" pattern="([A-Za-z0-9-!#$%&_+`{}|']+)?(\.[A-Za-z0-9-!#$%&_+`{}|']+)*@[A-Za-z0-9-]+\.([A-Za-z0-9]{2,})+" aria-required="true" required/>

The < input type="tel"> creates a section for inputting phone numbers.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

My website was unexpectedly adorned with an additional quotation mark by Chrome

Unexpectedly, Chrome inserted a quote that was not part of my code. Upon pressing F12 in Chrome, the added code is revealed. This extra quote caused a mysterious space at the top of my website. Removing the unnecessary quotes resolved the issue and everyt ...

Refresh HTML5 Canvas Drawing

Is it possible to create a meta code that efficiently toggles the visibility of a chart and grid by using checkboxes? Currently, I am redrawing the whole canvas whenever the 'Show Grid' setting is changed, but I'm hoping for a more optimized ...

Strategies for navigating dynamic references in Angular 2 components

I am working with elements inside an ngFor loop. Each element is given a reference like #f{{floor}}b. The variable floor is used for this reference. My goal is to pass these elements to a function. Here is the code snippet: <button #f{{floor}}b (click) ...

The transparent sticky navigation bar isn't functioning as intended

I stumbled upon a code for the sticky navbar that I found on this website. Intrigued, I decided to copy the code and test it out on my Laravel blade file. The output turned out like this: https://i.sstatic.net/lexRl.jpg Here is how I copied the code: CS ...

Navigating Liferay Portlet in reverse order

I am facing an issue with right to left alignment in my portlet. It displays correctly when tested on a regular HTML page, but switches to left to right alignment when integrated into a Liferay portlet. Below is the code snippet causing this problem: < ...

Animating back with a jQuery if statement

Is there a way to implement an if statement that triggers an animation when the right image reaches +400px, and then animates back to -400px upon hovering over the image? $('#left img').mouseenter(function() { $('#right img').animate ...

The system is unable to locate a supporting entity with the identifier '[object Object]', as it is classified as an 'object'

I'm currently working on an Angular 2 application where I am retrieving data from an API and receiving JSON in the following format. { "makes": null, "models": null, "trims": null, "years": null, "assetTypes": { "2": "Auto ...

Executing JavaScript code within ASP.NET Visual Basic

My current web application uses jQuery and JavaScript, but I want to add more features that are supported in ASP.net VB. However, I am unsure if the JavaScript can run after the VB code. Essentially, I would like the web app to follow this sequence: ...

Creating a designed pattern for a textbox: Let's get creative with your text

How can I create a Textbox that only allows numeric values or the letter 'A'? <input type="text" id="txt" name="txt" pattern="^[0-9][A]*$" title="Allow numeric value or only Letter 'A'&quo ...

Changing the selection in the Angular Mat-Select dropdown causes the dropdown's position to shift

Issue with dropdown position: The dropdown should display below the select element, but when selecting the second value, it appears on top of the select element. I have removed any relevant CSS to troubleshoot, but the problem persists. See screenshots for ...

How can I achieve rounded corners in Internet Explorer using JQuery?

I've tried using various plugins like curvycorners, DD_roundies, and behavior: url(ie-css3.htc);, but none of them seem to work properly. Can anyone suggest alternative methods for achieving rounded corners in IE? My website is designed to be resizabl ...

Struggling to align a div at the center of a screen

Snippet of HTML Code: <body> <!-- Social Media Icons --> <div id="sm1"><a href="/"><img src="images/facebook.png" height=40 width=40></img></a> </div> <div id="sm2"><a href="/"><img src="image ...

Is there a way to eliminate the return?

Struggling to eliminate the unwanted return in my Wordpress loop. The layout is ruined by trying to display a thumbnail next to the entry: Even using padding for the entry made it worse! Here's the code snippet that I have tried: #thumbnai ...

jQuery animation not executing as expected due to transition issues

I'm looking to create a cool effect where the previous quote disappears and a new one appears when I click on a button, all with a smooth transition effect. In my attempt below using jQuery .animate and opacity property, I'm struggling to make i ...

Closing a popover in NG-bootstrap from its container

I'm working on a container component named file-container, which includes an ngbPopover button. Inside the popover, there is another component used for selecting a file to upload. <button type="button" class="btn btn-secondary popover-btn ...

Having trouble displaying an image in your React project?

I'm having an issue with my code where the logo is not displaying, even though it should be in the src -> pages -> images folder. I can't seem to figure out why this is happening. import dress from "./images/dress.png"; const I1 = () => ...

Screen readers are unable to "read" text that is identified through aria-describedby

When enhancing my web application for accessibility, I encountered a challenge. I have implemented two required fields in a form that should display separate error messages as spans. To accomplish this, I am utilizing aria-invalid to signal when the fields ...

How come once I close a PrimeNG modal that is defined within a child component, I am unable to reopen it?

Currently, I am developing an Angular application that utilizes PrimeNG. In the process, I encountered a challenge. Initially, I had a component with a PrimeNG Dialog embedded within (refer to this link), and it was functioning properly. To streamline my ...

I am looking to place two HTML buttons next to each other on the same line

I am trying to display two HTML buttons next to each other on the same line, with the "Submit Request(s)" button appearing first. The issue I am facing is that the top of the second button aligns with the bottom of the first one. The second button is cor ...

Utilizing media queries and page width in a Moodle theme designed with Bootstrap framework

I currently have my LMS set up with Moodle 4 and the boost theme which is based on bootstrap (github) However, the default page layout appears very narrow on all devices and I would like to utilize the responsive design features of Bootstrap for different ...