Bug 245571 - Hover state on iOS background-color
Summary: Hover state on iOS background-color
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 16
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-23 04:49 PDT by Nilesh Prajapati
Modified: 2022-09-23 23:18 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.