Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compose-form-up

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compose-form-up - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

15

lib/input-change.js

@@ -86,2 +86,15 @@ var toolbox = require( 'compose-toolbox' ),

function checkRadioLabel ( input ) {
var input = ( input.target || input )
var inputName = input.name
var radioGroup = document.querySelectorAll('input[name=' + inputName + ']')
radioGroup.forEach(function(radioInput) {
var label = toolbox.getClosest( radioInput, 'label' )
return (radioInput.checked === true ? label.classList.add('checked-radio') : label.classList.remove('checked-radio'));
})
}
function watch () {

@@ -93,2 +106,3 @@ if ( watching ) { return }

toolbox.each( document.querySelectorAll('input[type=range],input[type=number]'), trackState )
toolbox.each( document.querySelectorAll('input[type=radio]'), checkRadioLabel )
})

@@ -98,2 +112,3 @@

Event.on( document, 'input', inputSelectors, inputChange )
Event.on( document, 'input', 'input[type=radio]', checkRadioLabel )

@@ -100,0 +115,0 @@ // Form.reset() doesn't fire input events. This ensures those events are fired.

2

package.json
{
"name": "compose-form-up",
"version": "2.0.3",
"version": "2.0.4",
"description": "A lightweight HTML5 form utility including validation, progressive forms, and other handy tools.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -55,2 +55,8 @@ var u = require('./_utils.js')

it( 'adds checked class to initially checked radio option', async () => {
await u.findElement( '#label-radio-1.checked-radio' )
await u.isNull( '#label-radio-2.checked-radio' )
await u.isNull( '#label-radio-3.checked-radio' )
})
it( 'detects changes to a radio input', async () => {

@@ -60,2 +66,7 @@ await u.isNull( '[type="radio"].changed-value' )

await expect( page ).toClick( '#radio-2' )
await u.isNull( '#label-radio-1.checked-radio' )
await u.findElement( '#label-radio-2.checked-radio' )
await u.isNull( '#label-radio-3.checked-radio' )
await u.findElement( '#radio-1.changed-value' )

@@ -65,2 +76,7 @@ await u.isNull( '#radio-3.changed-value' )

await expect( page ).toClick( '#radio-1' )
await u.findElement( '#label-radio-1.checked-radio' )
await u.isNull( '#label-radio-2.checked-radio' )
await u.isNull( '#label-radio-3.checked-radio' )
await u.isNull( '#radio-1.changed-value' )

@@ -67,0 +83,0 @@ await u.isNull( '#radio-2.changed-value' )

Sorry, the diff of this file is not supported yet

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