<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>134555</bug_id>
          <alias>[draggable]:hover</alias>
          <creation_ts>2014-07-02 13:28:20 -0700</creation_ts>
          <short_desc>:hover state sticks after a drag-and-drop</short_desc>
          <delta_ts>2026-03-03 14:35:22 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>UI Events</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.11</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://jsfiddle.net/zFk2V/3/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>NashvilEric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>a_protyasha</cc>
    
    <cc>ap</cc>
    
    <cc>asefkow</cc>
    
    <cc>benjamin</cc>
    
    <cc>bfulgham</cc>
    
    <cc>david</cc>
    
    <cc>enrica</cc>
    
    <cc>koivisto</cc>
    
    <cc>matiasnu</cc>
    
    <cc>rniwa</cc>
    
    <cc>thibault.clerc2</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit</cc>
    
    <cc>zarv1k</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1020016</commentid>
    <comment_count>0</comment_count>
    <who name="">NashvilEric</who>
    <bug_when>2014-07-02 13:28:20 -0700</bug_when>
    <thetext>## Overview

If you drag and drop to reorder a [draggable] element that also has a :hover psuedoclass, the hover state sticks to the dom element in the previous location.

Here is a fiddle of the issue:
http://jsfiddle.net/zFk2V/3/

I have verified this on Chrome 35.0.1916.153 and Safari 7.0.2 (9537.74.9).

## Steps to Reproduce

1. Drag an element
2. Notice that the hover state sticks to the previous element (both in visual effect and as revealed by the developer inspection tools)
3. hover and mouse away from the element and note that the hover state goes away

## Actual Results

The hover state persists, and dev tools show the element in `:hover` mode.

## Expected Results

No hover state should be present, or it should be cleared whenever any other element is hovered.

## Builds

My Chrome webkit version is 537.36.
There is a Stack Overflow issue about this from July 30th 2013, so this issues has been in the wild for a while I think.
http://stackoverflow.com/questions/17946886/hover-sticks-to-element-on-drag-and-drop</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1211898</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2016-07-17 20:45:57 -0700</bug_when>
    <thetext>This still reproduces on Safari Tech Preview 8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503347</commentid>
    <comment_count>2</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:19:15 -0800</bug_when>
    <thetext>Mass move bugs into the DOM component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1503620</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-06 21:04:18 -0800</bug_when>
    <thetext>Another bug which belongs to UI Events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1737732</commentid>
    <comment_count>4</comment_count>
    <who name="">asefkow</who>
    <bug_when>2021-03-09 13:15:07 -0800</bug_when>
    <thetext>Still reproduces in Safari 14 and Chrome 88</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1853141</commentid>
    <comment_count>5</comment_count>
    <who name="Thibault Clerc">thibault.clerc2</who>
    <bug_when>2022-03-21 03:48:56 -0700</bug_when>
    <thetext>This still reproduces in Chrome Version 99.0.4844.83</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020579</commentid>
    <comment_count>6</comment_count>
    <who name="Orangetronic">david</who>
    <bug_when>2024-03-12 15:32:24 -0700</bug_when>
    <thetext>I&apos;m still seeing this in Safari Version 17.3.1

If i run `document.querySelectorAll(&quot;:hover&quot;)` i can get an ElementList with a whole pile of things that are very much not under the mouse. 

Is there a workaround in the meantime to manually flush the contents of the `:hover` pseudo-selector after an onDrop event?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020729</commentid>
    <comment_count>7</comment_count>
    <who name="Orangetronic">david</who>
    <bug_when>2024-03-13 08:53:11 -0700</bug_when>
    <thetext>Anybody else who lands here looking for a work around, i&apos;ve found this works:

```
for (const child of document.body.children) { document.body.replaceChild(child, child) }
```

hope that saves somebody a bit of headache!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2078167</commentid>
    <comment_count>8</comment_count>
    <who name="Orangetronic">david</who>
    <bug_when>2024-11-29 07:03:56 -0800</bug_when>
    <thetext>(In reply to Orangetronic from comment #7)
&gt; Anybody else who lands here looking for a work around, i&apos;ve found this works:
&gt; 
&gt; ```
&gt; for (const child of document.body.children) {
&gt; document.body.replaceChild(child, child) }
&gt; ```
&gt; 
&gt; hope that saves somebody a bit of headache!

Lol this no longer works as a mitigation in latest Chrome (131.0.6778.86) &amp; Safari (18.x)

I&apos;m not having to work around this using a more targeted class name shuffle in my drag-end event to suppress hover styles etc until the user next moves the mouse. 

It looks like styles are getting computed against the mouse position from the start of the drag/drop event post-drop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2186740</commentid>
    <comment_count>9</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2026-03-03 14:35:05 -0800</bug_when>
    <thetext>It looks like Chrome and Firefox match behavior in the JS Fiddle test case. Safari still shows the hover state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2186741</commentid>
    <comment_count>10</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-03-03 14:35:22 -0800</bug_when>
    <thetext>&lt;rdar://problem/171662494&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>