CSS animation triggers filter transition malfunction in Google Chrome

My HTML contains several <a> tags that have different images as backgrounds. I want these <a> elements to move across the page in an animated manner and have a grayscale filter applied to them. When hovered over, they should return to their original state without the grayscale effect.

However, there seems to be an issue in the latest version of Chrome where the animation CSS rule interferes with the transition. The problem can be seen in the code snippet below. When hovering over the animated <div> elements for the first time, instead of transitioning smoothly, they instantly jump to the end animation state, which is filter: none. Changing the hovered CSS to filter: grayscale(0) does not resolve this problem.

If you continuously move your mouse in and out of the bounds of the <div> elements, the transition appears to work correctly. However, if you wait too long or try hovering over the other <div>, the transition breaks again.

I have tested this functionality in Firefox and Brave browsers, and it works fine. I remember implementing this feature on my website and testing it in Chrome where it worked initially. It seems like something has broken in the browser since then. I am unsure how to fix this issue or find a temporary workaround if it is indeed a bug in Chrome.

.thing {
  background-color: red;
  width: 50px;
  height: 50px;
  
  filter: grayscale(1);
  transition: filter 1s;
}

.thing:hover {
  filter: none;
}

.broken {
  animation: move linear 10s infinite;
}

@keyframes move {
  0% {
    transform: translateX(0%);
  }
  50% {
    transform: translateX(500%);
  }
}
<div class="broken thing">TEST1</div>
<div class="broken thing">TEST2</div>
<br>
<div class="thing">noanim</div>
<div class="thing">noanim</div>

Answer №1

It turns out there was a bug specific to Chrome that I encountered. The version causing the error was Version 102.0.5005.115, 64-bit.

Thanks to misterManSam's suggestion, updating Chrome resolved the issue. After relaunching the browser to complete the update (now on Version 103.0.5060.66), the transition worked correctly.

I had assumed my Chrome was up-to-date because it didn't prompt me for an update, but it was only after visiting chrome://settings/help that I realized I needed to restart the browser to finish updating. If you're experiencing a similar problem, ensure your browser is fully updated by restarting it.

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

The scrolling speed of my news div is currently slow, and I am looking to increase its

This is the news div with bottom to top scrolling, but it is slow to start scrolling. I want to increase the speed. The current behavior is the div appears from the y-axis of the system, but I want it to start exactly where I define. The scrolling div is ...

I'm looking to display images in a designated React component using create react app. What is the best way to accomplish

Currently in the process of revamping an older website using react. Making progress, but encountering an issue with a new component where images are not displaying. Strangely, the images appear in the main class but not within the component class. Even whe ...

The functionality of the anchor tag is restricted in both Chrome and Safari browsers

I'm having an issue with HTML anchor tags not working properly in Chrome and Safari. Instead of scrolling up, the page scrolls down when clicked. Here is the HTML code I'm using: <a id="to-top"></a> <a class="button toTop" href="# ...

In what ways can I incorporate Django template tags into my JavaScript code?

I've encountered an issue with implementing my model data into a FullCalendar library template in JavaScript. Despite seeing others do the same successfully, I keep getting errors as the template tags fail to register properly. <script> documen ...

Creating an interactive date selection feature with a calendar icon in MVC 5

I currently have a textbox that displays the datepicker when clicked. However, there is now a requirement to add a calendar icon inside the textbox. The datepicker should be displayed when either the calendar icon or the textbox is clicked. Below is the co ...

Obtaining material for optimizing a dynamic image

I'm facing a challenge with my responsive image setup. The image is filling the top half of the screen as intended, but I can't seem to get the content underneath it to stay below the image as it resizes. Instead, the content ends up overlapping ...

Tailwind configuration is failing to export complete CSS styles

I have been attempting to integrate the entire Tailwind 3.0 CSS library into a new Laravel 8.* project in order to utilize the corePlugins feature to eliminate unwanted styles. Despite setting everything up quickly, I am only seeing the basic styles publis ...

Guide on adjusting canvas height to match Full Document height (covering entire page)

Hello everyone, I'm getting in the holiday spirit by adding some snow falling effects using Canvas and it looks pretty awesome. The only issue is that it's filling up the entire screen due to: c.width = innerWidth; c.height = innerHeight; If a ...

Leveraging an external Typescript function within Angular's HTML markup

I have a TypeScript utility class called myUtils.ts in the following format: export class MyUtils { static doSomething(input: string) { // perform some action } } To utilize this method in my component's HTML, I have imported the class into m ...

Adjust the content of an iframe based on the size of the screen

Hi there, I'm currently facing an issue with an ad that can't be resized. The support team suggested using two different ads - one for mobile and one for desktop. The dimensions of the ads are 720 x 90 and 300 x 100. I would like the ad to automa ...

Populate a database with information collected from a dynamic form submission

I recently created a dynamic form where users can add multiple fields as needed. However, I'm facing a challenge when it comes to saving this data into the database. You can view a similar code snippet for my form here. <form id="addFields" me ...

Effortlessly navigate between Formik Fields with automated tabbing

I have a component that validates a 4 digit phone code. It functions well and has a good appearance. However, I am struggling with the inability to autotab between numbers. Currently, I have to manually navigate to each input field and enter the number. Is ...

I'm curious as to why the web browser is showing a timestamp below the image I have on my HTML page

Issue at Hand: I am currently working on coding a website that involves displaying an image. However, when the image is loaded, a timestamp appears underneath it in the web browser. Query: Could you please shed some light on why a timestamp is showing up ...

A dynamic 3-column layout featuring a fluid design, with the middle div expanding based on the

Sorry for the vague title, I'm struggling to explain my issue clearly, so let me elaborate. I am using flexbox to create a 3-column layout and want the middle column to expand when either or both of the side panels are collapsed. Here is a screenshot ...

How can the end event of a custom CSS animation be bound using jQuery or JavaScript?

We are currently managing multiple animations on the same object and need to execute different actions once each animation is complete. At present, we listen for the webkitAnimationEnd event and use a complex if/then statement to handle each animation sep ...

tips for expanding the size of your images

Hey there, I'm looking for some help with the code below. I need to increase the width of the images and remove the border of the slider div which is currently showing a white border that I want to get rid of. I am using JavaScript to display the imag ...

Error in Chrome Extension Data Type

I am having trouble adding a highlighted red button to YouTube. The code does not seem to be working as expected. manifest.json { "name": "Example", "version": "0.0", "manifest_version": 2, "c ...

Position the select tag adjacent to the textbox

Looking for assistance on how to arrange the <select> tag beside the "Desired Email Address" field within my email registration form. I believe a modification to the CSS code is necessary. Below you will find the HTML and CSS (snippet) related to th ...

Transferring information from a component that includes slot content to the component within the slot content

This task may seem complex, but it's actually simpler than it sounds. I'm struggling with the correct terminology to enhance the title. I need to transfer data from a component that includes slot content to that slot content component. In partic ...

What is the method for utilizing script bundles in pure HTML (not cshtml)?

After reviewing the following two questions on Stack Overflow, I made sure not to ask a duplicate question: 1) @Render.Scripts in plain .html file - not in .cshtml 2) Rendering the script bundle in a plain HTML page I am curious about how to incorporate ...