Bug 245571

Summary: Hover state on iOS background-color
Product: WebKit Reporter: Nilesh Prajapati <nileshprajapati>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: thorton, wenson_hsieh
Priority: P2    
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   

Description Nilesh Prajapati 2022-09-23 04:49:49 PDT
Issue: Hover styling applied to button on the touch screen.


I notice an issue with the hover state on a touch screen device where the hover styling is applied and occurs when toggling a button (e.g. a navigation menu).

This issue only occurs when a user exits the navigation menu or selected a button on the same page.

A hover styling is presented and disappears when clicking away from the button.


While "@media (hover) and (pointer: fine)" media queries do fix this issue. 

 
@media (hover) and (pointer: fine) {
    button:hover {
        background: yellow;
    }
}

I am on the assumption that the CSS hover should only apply to devices with a mouse cursor, etc.


Please correct me if this is wrong.
Comment 1 Tim Horton 2022-09-23 23:18:16 PDT
This is longstanding behavior intended to make pages that are not touch-adopted (and depend on hover for important functionality) work on touch-only devices.