The functionality of the input type range with a smaller :active slider can be inconsistent on iOS Safari

In my HTML5 code, I have implemented a range input slider with a smaller handle when the slider is active. This functionality works perfectly across all supported web browsers except for Safari on iOS (specifically tested on an iPhone).

However, in Safari on iOS, changing the width and height CSS attributes in the :active class makes it challenging to manipulate the slider handle to adjust the value. The slider appears active and the size changes, but it becomes unresponsive to finger movements while attempting to slide it.

I have created a CodePen example showcasing two sliders - the top one functions smoothly, while the bottom one occasionally struggles to be manipulated in Safari https://codepen.io/tobbe_lundberg/pen/wvervQx

Below is the CSS code snippet used:

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 32px;
  margin-top: 40px;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: pink;
  height: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 56px;
  width: 56px;
  background: pink;
  margin-top: -24px;
}

input[type="range"]:active::-webkit-slider-thumb {
  height: 56px;
  width: 56px;
  margin-top: -24px;
}

input.resize[type="range"]:active::-webkit-slider-thumb {
  height: 24px;
  width: 24px;
  margin-top: -10px;
}
<input type="range" min="0" max="100" step="1"/>
<input class="resize" type="range" min="0" max="100" step="1"/>

Is there a way to achieve the resize effect in Safari as well using only CSS?

Answer №1

Update: I found a workaround for this issue, although it may not be suitable for everyone and qualifies as somewhat of a creative solution. My approach involved making the thumb appear smaller visually without actually reducing its size. By adding a nearly transparent border (or one that matches the background color), you can counterbalance the apparent reduction in size.


This explanation was too lengthy to share in a comment section. Have you managed to resolve the problem at hand? I'm encountering similar difficulties, albeit with a minimalist slider thumb design initially.

Upon reviewing your challenge, I experimented with an unconventional idea: enlarging the slider thumb significantly when active. Surprisingly, this method greatly improves ease of use by enhancing thumb visibility and grabbability.

An important observation worth mentioning is that altering the slider thumb size impacts the slider range and consequently shifts the thumb position accordingly. Enlarging the thumb substantially results in compressing the entire range into a shorter span.

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

Adjust the width of the TinyMCE Editor to automatically resize based on the content being

Is it possible for TinyMCE to adjust the content within an absolutely positioned container and update the width while editing? <div class="container"> <textarea>This is my very long text that should not break. This is my very long text tha ...

Enhancing the functionality of localStorage

I am attempting to append a value to a key within the HTML5 localStorage. Take a look at my code below: var splice_string = []; splice_string += "Test value"; var original = JSON.parse(localStorage.getItem('product_1')); origina ...

A curious phenomenon observed in the behavior of the jQuery offset() method

Once I executed the following code snippet multiple times: $view.offset({ left : X, //X remains constant top : this.y }); console.log($view.offset()); //displays expected output I noticed (using Firebug) that the HTML code looked like this: <di ...

Safari is unable to display the button text, while Chrome has no problem showing it

In Safari, the text of the button is not showing up properly. I am able to retrieve the text using jQuery in the console though. However, there seems to be an issue with recognizing the click event. <div class="btn-group btn-group-lg"> <button ...

Display a limited number of characters along with a button on the blog tag pages. Clicking on the button will reveal the complete text description

Hey, I am looking to replicate the way WooCommerce tags descriptions are displayed on my WordPress blog. I want it to show only a certain number of characters with a "show all" link, similar to how it appears on this site: I have found some code that work ...

jQuery datatables provide a powerful feature for column filtering using jQuery functions

Looking for advice on how to add a filter to my jQuery datatable column that contains checkboxes. I want the filter to be a drop-down menu with options for "checked" and "unchecked", so that when a user selects one of these options, only the rows contain ...

Storing the slider value in a universal variable and displaying it in a div

I am currently working on a jQuery slider feature for my project. My goal is to extract the value from the slider, display it in a div element, and store it as a global JavaScript variable. It needs to perform these actions immediately as the slider is bei ...

The bootstrap navbar-collapse feature is causing a shift in the orientation of the navigation elements

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="navbar navbar-default" role="nav ...

custom gradient generator for jquery and css3

Is there a jQuery CSS3 plugin available that can handle cross-browser gradients? I've noticed that most gradient plugins out there involve creating multiple elements. Thank you. Edit: I apologize for any confusion - I'm not attempting to force ...

What is the best way to accommodate 4 columns within a 3-column HTML table layout?

I am facing a challenge with my table layout. Normally, it has 3 columns, but I am trying to figure out how to fit 4 cells into one row while maintaining the same width. Any suggestions on how to achieve this? ------------- | 1 | 2 | 3 | ------------- | ...

Trouble with Styling React-Toastify in TypeScript: struggling to adjust z-index in Toast Container

Currently in the process of developing a React application utilizing TypeScript, I have incorporated the React-Toastify library to handle notifications. However, encountering some challenges with the styling of the ToastContainer component. Specifically, ...

Troubleshooting: Issue with displaying PHP data on an AngularJS table using JSON through jQuery AJAX

I've been encountering an issue while trying to display data from a database on my HTML page using Angular and JSON. Despite the browser being able to read the database, it fails to show the data. Can anyone shed some light on why this might be happen ...

Mismatched Background for Active Links in HTML/CSS Menu

My HTML menu has a unique feature that highlights the currently active page using a specific class. <div id="menu"> <ul> <li class="activelink"><a href="index.html">Home</a></li> <li><a href ...

Loading screen in Next.js

Is there a way to implement a loader page during transitions within the same web application using Next JS? During development, the pages transition smoothly with the CSS applied correctly. However, when moving the application to production environment, t ...

Box surrounding the image with a shade of gray, all thanks to

Despite trying to set "outline: none" and tweaking the border, I'm unable to resolve the issue. For reference, you can visit the page here: . I've shared the link because I'm unsure of what exactly needs fixing or adding on the page. Any gui ...

Attempting to insert a dynamic variable into a jQuery click event selector

I'm facing an issue where I am attempting to use a variable as a selector within a click event for a dynamically generated row in a table. When I manually enter the class name, the row click event works perfectly. However, when I try to use the variab ...

Customize GridView Appearance in ASP.NET

After using the examples provided at this link, I was able to get everything working smoothly. However, the issue I'm facing now is with the style of the GridView. When the gridview first loads, it looks perfect. But when I click on the Edit button, t ...

streaming an HTML5 video directly from memory source

After retrieving multiple encrypted data using ajax queries and performing necessary manipulations to turn them into a valid video, I find myself at a standstill. The binary of the video is now stored in memory, but I am unsure how to display it. To confi ...

Why isn't the maxlength attribute showing up in the rendered HTML code?

One of the elements in my project is a textbox with its text mode set to multiline, which essentially turns it into a textarea. Here's an example of how it looks: <asp:TextBox ID="txtFinBillingTerms" maxlength="500" runat="server" ToolTip="(e.g. 9 ...

section featuring a striking visual, user input form, and descriptive content

I want to create a layout with a background image in a div, a signup form on the right side, and a div containing h1 tags on the left side. Here is the HTML code: <html> <title> GoToMy PC </title> <head> <link rel="stylesheet" ...