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

@infermedica/component-library

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@infermedica/component-library - npm Package Compare versions

Comparing version 1.6.4 to 1.6.5

src/utilities/helpers/focus-on-first-invalid-choice/index.ts

4

package.json
{
"name": "@infermedica/component-library",
"version": "1.6.4",
"version": "1.6.5",
"description": "Vue 3 UI library for healthcare and not only.",

@@ -118,2 +118,2 @@ "license": "MIT",

}
}
}

@@ -9,5 +9,7 @@ import UiMultipleChoices from '@/components/organisms/UiMultipleChoices/UiMultipleChoices.vue';

computed,
nextTick,
} from 'vue';
import { actions } from '@storybook/addon-actions';
import { modifiers } from '@sb/helpers/argTypes';
import focusOnInvalidChoice from '@/utilities/helpers/focus-on-first-invalid-choice';

@@ -129,2 +131,16 @@ const events = actions({

const invalid = ref(args.initInvalid);
const invalidChoices = ref(null);
const handleSubmit = async () => {
await focusOnInvalidChoice(invalidChoices);
const { focusInvalidInput } = focusOnInvalidChoice(invalidChoices);
// Note: Two nextTick functions are required to focus on the first invalid input after page load.
await nextTick();
await nextTick();
focusInvalidInput();
};
handleSubmit();
return {

@@ -135,5 +151,7 @@ ...args,

invalid,
invalidChoices,
};
},
template: `<UiMultipleChoices
ref="invalidChoices"
v-model="modelValue"

@@ -160,2 +178,15 @@ v-model:invalid="invalid"

const invalid = ref(args.initInvalid);
const invalidChoices = ref(null);
const handleSubmit = async () => {
const { focusInvalidInput } = focusOnInvalidChoice(invalidChoices);
// Note: Two nextTick functions are required to focus on the first invalid input after page load.
await nextTick();
await nextTick();
focusInvalidInput();
};
handleSubmit();
return {

@@ -166,5 +197,7 @@ ...args,

invalid,
invalidChoices,
};
},
template: `<UiMultipleChoices
ref="invalidChoices"
v-model="modelValue"

@@ -471,2 +504,15 @@ v-model:invalid="invalid"

const invalid = ref(args.initInvalid);
const invalidChoices = ref(null);
const handleSubmit = async () => {
const { focusInvalidInput } = focusOnInvalidChoice(invalidChoices);
// Note: Two nextTick functions are required to focus on the first invalid input after page load.
await nextTick();
await nextTick();
focusInvalidInput();
};
handleSubmit();
return {

@@ -477,5 +523,7 @@ ...args,

invalid,
invalidChoices,
};
},
template: `<UiMultipleChoices
ref="invalidChoices"
v-model="modelValue"

@@ -482,0 +530,0 @@ v-model:invalid="invalid"

@@ -5,1 +5,2 @@ export * from './capitalize-first/index';

export * from './equal/index';
export * from './focus-on-first-invalid-choice/index';

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