The Tailwind CSS class "ring-inset" does not appear to be appearing on iPhone devices when applied to form inputs

I have implemented custom styling for form inputs in my Next.js project using Tailwind CSS classes.

Below is the code snippet that showcases how I have styled the form inputs:

import * as React from "react";
import { cn } from "@/lib/util";

interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}

const Input = React.forwardRef<HTMLInputElement, InputProps>(
  ({ type, className, ...props }, ref) => {
    return (
      <input
        type={type}
        className={cn(
          "h-10 w-full rounded-md border-0 px-3 py-2 shadow bg-transparent ring-1 ring-inset ring-neutral-200 transition ease-out placeholder:text-neutral-400 focus:ring-2 focus:ring-inset focus:outline-none focus:ring-neutral-400 sm:text-sm",
          className,
        )}
        ref={ref}
        {...props}
      />
    );
  },
);

Input.displayName = "Input";

export { Input };

In this implementation, I have used a ring instead of a border around the input field. The relevant CSS classes for this are:

border-0 ring-1 ring-inset ring-neutral-200
. However, there seems to be an issue with this styling on mobile devices.

Upon inspecting the login form using Chrome Dev Tools in responsive mode, I can see the ring and shadow effect around the input, as shown below:

https://i.sstatic.net/WfVn1.png

But strangely, when accessing the website on my iPhone, the ring effect is not visible around the input fields:

https://i.sstatic.net/SrVv0.jpg

I would greatly appreciate assistance in understanding why this inconsistency is occurring between different devices.

If you would like to view the login form directly, please visit the following link:

Answer №1

When utilizing tailwind, it utilizes the box-shadow for the ring-* classes. Sometimes, on iOS devices, forms can appear distorted. To address this issue, you can adjust the input style like so:

input {
  -webkit-appearance: none !important;
}

For more information, refer to this link

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

When using the navbar in Tailwind CSS, the image is appearing distorted instead of aligning properly with the adjacent

I am trying to add a flag, login button, and sign up button Using class="flex", I placed an image inside it However, when I add the buttons, the image gets distorted. How can I prevent this? Expected Outcome I want to create the flag, login but ...

Exclude option experiencing issues with skip and select features

const productsInventory = await prisma.inventory.findMany({ skip: (currentPage - 1) * quantityPerPage, take: JSON.parse(quantityPerPage), include: { warehouses_stock: true, }, }); return NextResponse.json(productsInventory); The pagination is ...

The responsive class seems to be malfunctioning within the Laravel 5.3 framework

I have a project that involves Laravel and Vue.js. In my Laravel project, I am importing Bootstrap CSS using the following line: // Bootstrap @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; This import is done in the app.scss file. ...

Learn how to create a half and half color scheme in an HTML table

I have created an HTML table that resembles a calendar. Various events are registered in the calendar, each distinguished by its color. However, I am looking to change the colors of the cells to be half and half. https://i.sstatic.net/gaQq2.png The imag ...

Turn off validation for back button in Django form

I have a form in Django 1.10 that displays quiz questions and a result at the end. I want to add two more buttons beside the "Check" button: "Mark" and "Back". When the user clicks on "Back", the view handles the behavior correctly, but a pop-up appears wi ...

Stack the text on top of each other beside an image

Here is some HTML code that I am working with: <div class="row"> <div col-md-9> <div> <img class="img-valign" src="an image"> <span class="text1" Style="font-size: 8 ...

Using Firebase Firestore to fetch an array field from a particular document and then leveraging those array values for mapping other documents

In my database, I have user and group collections. Each document in the user collection corresponds to a user UID and contains an array field called "userGroups" which lists the groups that user belongs to, with each group being identified by the group&apo ...

Trouble Ensues as CSS Div Refuses to Center

I'm in the process of creating a practice website to improve my HTML and CSS skills, but I'm having trouble centering a specific div. I've attempted to use margin: 0 auto, but it doesn't seem to affect the positioning of the div at all. ...

Creating dynamic backend routes in NextJS is a great way to add flexibility to

Is there a way for me to implement dynamic backend routes? I am working on an image hosting platform where users should be able to save their images on the server under unique domains like http://localhost/<random_id>. An example link would look so ...

Eliminate Bootstrap's validation glyphs

Issue Description I am attempting to eliminate the validation icons from Bootstrap, such as the "x" and "check" symbols. Despite my efforts to search thoroughly, I have been unable to locate where these icons are located in the code. Code Sample You can ...

Change the color of this element and input field background

Having trouble with setting the background color of an input field to red in this code: $(document).ready(function(){ $(".abc").focus(function(){ $(this).attr('background', 'red'); $("label").text('Insert tex ...

Develop a JSON structure that represents an array of dynamically generated fields in PHP

Need help converting data from a PHP form into a specific JSON format. Struggling to create the right array that can be easily converted into JSON format. Here is a snippet of the array structure: Array ( [user_id] => [title2] = ...

Assigning the Style property to an element using a string that includes HTML tags

My HTML string is populated with elements such as button, li, span, and more. I am looking to add specific styles to buttons based on their class name. For example, if button.btn { some styles } and button.btn-success { some other styles } O ...

Is there a way to choose a div in Jsoup that lacks an id or any attributes?

I am facing a challenge where I have to choose a specific div using Jsoup. Traditionally, divs can be selected based on their id or class attributes using getElementById() for IDs and getElementsByClass() for classes. However, the div that I need to select ...

"Exploring the versatility of Tailwind css: A guide to implementing multiple themes

I know how to customize dark and light themes in tailwind, but I'm curious about extending this functionality to include additional themes such as pink, blue, red, etc. Is there a way to achieve this with regular tailwind CSS? <p className="t ...

Attempting to alter the background image through the action of clicking on an image using jQuery, HTML, and CSS

I have created custom weather icons like a sun, cloud, and rainy cloud using Photoshop. My goal is to allow users to click on these icons and change the background image of the website's body. However, despite my efforts, clicking on the images does n ...

"Exploring the world of skyrocketing data reads with Firestore integration in Next.js

I set up a page to display a collection of data and automatically update a document whenever changes are made. However, I noticed a significant increase in my read counts - over 2k reads for only 250 docs even after opening the page just three times. Ideal ...

What would be more efficient: inputting all items in a form at once or adding them one by one consecutively

My mind is preoccupied with a dilemma: is it better to have all possible items already on the form, or should items only be added when the user requests them? Let me elaborate - Imagine I have a form with 4 input fields and one textarea. Alongside that, t ...

Multiple images overlapping each other in a dynamic parallax effect

Despite my fear of receiving down votes, I have been unsuccessful in finding the answer to my question so I will proceed with asking it. I am attempting to replicate a parallax effect similar to the one showcased on this website, particularly the image of ...

Move the Bootstrap modal footer button to the left side

I am trying to align the cancel button to the left of the footer and keep the close and save buttons on the right side at all times. Even after adding the float:left property to the cancel button, it did not solve my issue. I would appreciate any solution ...