@uswds/uswds
Version:
Open source UI components and visual style guide for U.S. government websites
16 lines (15 loc) • 666 B
JavaScript
module.exports = {
// This used to be conditionally dependent on whether the
// browser supported touch events; if it did, `CLICK` was set to
// `touchstart`. However, this had downsides:
//
// * It pre-emptied mobile browsers' default behavior of detecting
// whether a touch turned into a scroll, thereby preventing
// users from using some of our components as scroll surfaces.
//
// * Some devices, such as the Microsoft Surface Pro, support *both*
// touch and clicks. This meant the conditional effectively dropped
// support for the user's mouse, frustrating users who preferred
// it on those systems.
CLICK: "click",
};