UNPKG

noph-ui

Version:

Noph UI is a modern, powerful UI library for Svelte 5, fully aligned with the Material 3 guidelines. Build stunning, consistent user interfaces with the efficiency and flexibility of Svelte and Google’s Material Design framework.

14 lines (13 loc) 348 B
export const isFirstInvalidControlInForm = (form, control) => { if (!form) { return true; } let firstInvalidControl; for (const element of form.elements) { if (element.matches(':invalid')) { firstInvalidControl = element; break; } } return firstInvalidControl === control; };