When the input type is in the :focus state, switch it from "email" to "text"

Having an issue where my input field, which is initially of type "email", changes to type "text" when in a :focus state. Additionally, it appends

kl_ab.original_type="email"
at the end of the input tag. This poses a problem as I require the browser to validate the user's email address accurately, and changing from type email to type text upon focus causes the first character entry to be marked as correct. To provide clarity, I will attach two screenshots captured from the developer tools - one showing the email form unfocused, and the other in the :focus state along with the relevant code.

UNFOCUSED INPUT
https://i.sstatic.net/pLFnj.png

INPUT WITH THE :focus STATE https://i.sstatic.net/tdtoS.png

HTML CODE

<form action="#" class="form">
     <div class="form__group">
       <input type="email" class="form__input" placeholder="Email address" id="email" required>
       <label for="email" class="form__label">Email address</label>
     </div>  
</form>

SCSS CODE

.form {

  &__group:not(:last-child) {
    margin-bottom: 2rem;
  }

  &__input {
    font-size: 1.5rem;
    font-family: inherit;
    color: inherit;
    padding: 1.5rem 2rem;
    border-radius: 2px;
    background-color: rgba($color-white, .5);
    border: none;
    border-bottom: 3px solid transparent;
    width: 80%;
    display: block;
    transition: all .3;

    &:focus {
      outline: none;
      box-shadow: 0 1rem 2rem rgba($color-black, .1);
      border-bottom: 3px solid $color-primary;
    }

    &:focus:invalid {
      border-bottom: 3px solid $color-secondary-dark;
    }

    &::-webkit-input-placeholder {
      color: $color-grey-dark-2;
    }
  }

  &__label {
    font-size: 1.2rem;
    font-weight: 700;
    margin-left: 2rem;
    margin-top: .7rem;
    display: block;
    transition: all .3s;
  }

  &__input:placeholder-shown + &__label {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4rem);
  }
}

Answer №1

I am familiar with the solution to this issue because I experienced the same thing.

  kl_ab.original_type="email"

This specific attribute is automatically inserted at the conclusion of the input tag as a result of installing the Kaspersky antivirus extension on your browser.

Kaspersky makes an automatic adjustment by inserting

kl_ab.original_type=" email"
and altering the input type from email to text.

If you choose to disable or uninstall the Kaspersky antivirus extension from your browser, you will no longer encounter this particular issue.

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

What is the reasoning behind the return type of void for Window.open()?

There is a difference in functionality between javascript and GWT in this scenario: var newWindow = window.open(...) In GWT (specifically version 1.5, not sure about later versions), the equivalent code does not work: Window window = Window.open("", "", ...

Opening a PHP file without performing thorough validation in JavaScript can lead to security vulnerabilities

I am in need of some assistance. I am currently working on a form and seem to be encountering an issue. Whenever I click on the submit button without checking the full validation, it performs the PHP action. For instance, when I input a serial number into ...

What steps do I need to follow to create a unique angular component that allows for customizable width using CSS styles?

The instructions on this website suggest that the width of the side-nav can be changed using CSS like so: md-sidenav { width: 200px; } This leads me to wonder, can I apply standard CSS properties such as width, position, etc... to custom components wi ...

Troubleshooting: CSS Animation Not Showing up on Screen

When I was attempting to create a JavaScript game in HTML, I encountered a problem. Despite ensuring that the syntax was correct and conducting some research online, the animation refused to display. No matter how many times I tried, it just would not work ...

Transition smoothly between sections using fullPage.js with clipping path effects

I am looking to create a unique clipping animation utilizing SVG clipping path. The animation should hide the first section while revealing the second section in a smooth transition using fullPage.js. This idea is somewhat similar to the question discusse ...

CSS search bar with sharp corners and radius ignored

I am currently developing an Android application using Angular NativeScript, and I'm aiming to implement a search bar with rounded corners. My HTML code looks like this: <SearchBar class="search"></SearchBar> In my CSS file, I h ...

Get the application/pdf document that was just sent to you from the software backend

I am facing an issue with downloading a PDF file sent from the backend. Upon receiving a blob response, I notice that when I download and view the file, the sheets are empty, matching the expected number of sheets. Could this be a coding problem? Current ...

Enlargen div or unordered list according to content exceeding limits

What is the best way to ensure a div expands when it contains a lot of content? Code Example (HTML): <div class="content"> Content goes here <br /> Content goes here <br /> Content goes here <br /> Content goes her ...

How do you update the icon for a webpage in HTML?

I'm looking to update the icon on a button when it is clicked. It would be helpful to know if I can also add an animation to the icon after the button click. ...

What is the best way to create three buttons for selecting various parameters?

I have a code snippet where I want to assign different parameters to each button when clicked. However, despite my logic, the functionality is not working as expected. Can someone help me with the correct syntax? For example, if I click the "Start (Easy) ...

Creating a scrollable interface for horizontal button navigation

Is there a way to create a horizontal button scrollbar using only HTML and CSS? I want it to look like this: https://i.stack.imgur.com/RWFRt.png After searching online for a solution, I came up with the following code: .myBtnContainer{ display: gri ...

Ensure that the text is wrapped properly when implementing innerHTML functionality

Within my Angular 5 application, I am faced with a requirement to display HTML content retrieved from a database. An example of the text stored in the database is: <div><u>Documents and Files</u></div><ul><li>These docu ...

What is the best way to input accurate image directories from a form into a MySQL database?

As a newcomer to the dynamic website creation realm, I've encountered a challenge when it comes to storing the complete image path in a MySQL database table. The issue arises when I attempt to create a form with both "text" inputs and "file" inputs. ...

Is anyone experiencing difficulties with IOS 8.3 when trying to assign colors to Font Awesome icons using content?

I'm encountering an issue on IOS 8.3 where I click a checkbox and the arrow color should be green, but it shows up as black instead. Is there a bug fix for this in IOS or is it simply not supported? Here is my SASS/css code: input[type="checkbox"] ...

The Arabic characters are not rendering correctly

As a beginner in html programming, I am looking to include Arabic text in my html file. I have added the following line containing Arabic text: <h1 dir="rtl">نص تجريبي لاختبار</h1> However, when I view the output, I am seeing u ...

Exploring the implementation of toggling functionality for nested children within <li> elements using jQuery

Unable to get the toggle function working on child nodes. Can someone assist me with this issue? $(document).ready(function() { $('label.tree-toggler').click(function() { $(this).parent().children('ul.tree').toggle(300); }); ...

Steps to retrieve the chosen value and visible text from a dropdown menu when clicking a button in Angular version 7

When the button is clicked, I want to display the selected text (green..) and value (1..) from a dropdown select. I attempted using ngmodel but was only able to capture the value, and an empty option is appearing in the select field. Below is the provide ...

Navigating through PlayFramework 2.X to access automatically created content

In my Play app, there is a specific process that creates a text file. I am looking to transfer this text file to a designated directory so it can be accessed through a static route. However, when the app is in production mode, the public assets folder is ...

What might be causing the issue with my jQuery hover function not working as expected?

I'm having trouble with defining a hover function for the buttons I created. It seems like the if/else condition is not working properly. What I want to achieve is changing the background color of my button when hovering based on a specific condition. ...

The images fail to load on Mozilla browser and appear as blank spaces

My images are only displaying as white in Mozilla but fine on other browsers. I've tried using -moz without success. It's a simple fix that I can't seem to locate. Any help would be appreciated. Just a quick note, the images appear blank wh ...