Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: input component value type to any #730

Merged
merged 1 commit into from
May 6, 2023

Conversation

huntabyte
Copy link
Contributor

Closes #727

πŸ“‘ Description

Update the Input component's value type to be any which aligns with svelte/elements HTMLInputAttributes

Status

  • Completed

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • I have checked the page with https://validator.unl.edu/
  • All the tests have passed
  • My pull request is based on the latest commit (not the npm version).

β„Ή Additional Information

@stackblitz
Copy link

stackblitz bot commented May 4, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link

vercel bot commented May 4, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
flowbite-svelte βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback May 4, 2023 11:30pm
flowbite-svelte-update βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback May 4, 2023 11:30pm

@jjagielka
Copy link
Contributor

@shinokada I'm ok with that PR.

@shinokada
Copy link
Collaborator

I prefer string | number | undefined to any as you suggested.

@jjagielka
Copy link
Contributor

From https://github.com/sveltejs/svelte/tree/master/elements/index.d.ts

export interface HTMLInputAttributes extends HTMLAttributes<HTMLInputElement> {
	accept?: string | undefined | null;
	alt?: string | undefined | null;
	autocomplete?: string | undefined | null;
	capture?: boolean | 'user' | 'environment' | undefined | null; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute
	checked?: boolean | undefined | null;
	crossorigin?: string | undefined | null;
	disabled?: boolean | undefined | null;
	form?: string | undefined | null;
	formaction?: string | undefined | null;
	formenctype?: string | undefined | null;
	formmethod?: string | undefined | null;
	formnovalidate?: boolean | undefined | null;
	formtarget?: string | undefined | null;
	height?: number | string | undefined | null;
	list?: string | undefined | null;
	max?: number | string | undefined | null;
	maxlength?: number | undefined | null;
	min?: number | string | undefined | null;
	minlength?: number | undefined | null;
	multiple?: boolean | undefined | null;
	name?: string | undefined | null;
	pattern?: string | undefined | null;
	placeholder?: string | undefined | null;
	readonly?: boolean | undefined | null;
	required?: boolean | undefined | null;
	size?: number | undefined | null;
	src?: string | undefined | null;
	step?: number | string | undefined | null;
	type?: HTMLInputTypeAttribute | undefined | null;
	value?: any;
	width?: number | string | undefined | null;

See the type for value?:

@shinokada
Copy link
Collaborator

shinokada commented May 6, 2023

Ok, I'm convinced.
Thank you for the link.

@shinokada shinokada merged commit 048caa0 into themesberg:main May 6, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

null should be an acceptable value type of <Input />
3 participants