New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@financial-times/o-header

Package Overview
Dependencies
Maintainers
18
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/o-header - npm Package Compare versions

Comparing version 8.3.0 to 8.3.1

20

dist/js/header.js

@@ -20,21 +20,2 @@ "use strict";

// Some assistive technologies, like screen readers, suggest to press 'space'
// when interacting with a link with a role of 'button'.
// We need to ensure that we replicate this functionality that exists on a button element.
// In the future we should consider using the 'button' element instead.
function handleSpaceKeydown(e) {
// get the target element
var target = e.target;
var targetIsRoleButton = target.getAttribute('role') === 'button'; // if the pressed key is a space, we'll simulate a click
var keyPressIsSpace = e.keyCode === 32;
if (targetIsRoleButton && keyPressIsSpace) {
// prevent space from scrolling the page
e.preventDefault(); // trigger the target's click event
target.click();
}
}
class Header {

@@ -64,3 +45,2 @@ constructor(headerEl) {

headerEl.addEventListener('keydown', handleSpaceKeydown);
this.headerEl.removeAttribute('data-o-header--no-js');

@@ -67,0 +47,0 @@ this.headerEl.setAttribute('data-o-header--js', '');

2

package.json

@@ -28,3 +28,3 @@ {

"name": "@financial-times/o-header",
"version": "8.3.0",
"version": "8.3.1",
"dependencies": {

@@ -31,0 +31,0 @@ "@financial-times/o-colors": "^5.0.0",

@@ -7,20 +7,2 @@ import search from './search';

// Some assistive technologies, like screen readers, suggest to press 'space'
// when interacting with a link with a role of 'button'.
// We need to ensure that we replicate this functionality that exists on a button element.
// In the future we should consider using the 'button' element instead.
function handleSpaceKeydown (e) {
// get the target element
const target = e.target;
const targetIsRoleButton = target.getAttribute('role') === 'button';
// if the pressed key is a space, we'll simulate a click
const keyPressIsSpace = e.keyCode === 32;
if (targetIsRoleButton && keyPressIsSpace) {
// prevent space from scrolling the page
e.preventDefault();
// trigger the target's click event
target.click();
}
}
class Header {

@@ -47,4 +29,2 @@

headerEl.addEventListener('keydown', handleSpaceKeydown);
this.headerEl.removeAttribute('data-o-header--no-js');

@@ -51,0 +31,0 @@ this.headerEl.setAttribute('data-o-header--js', '');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc