Skip to content

Commit 7d7a6e2

Browse files
committed
✨ Add onInput support for Input components
1 parent 45461f8 commit 7d7a6e2

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/components/Input/Input.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
export let className: SvelteInputProps['className'] = ''
1313
export let onChange: SvelteInputProps['onChange'] = () => {}
1414
export let onKeyUp: SvelteInputProps['onKeyUp'] = () => {}
15+
export let onInput: SvelteInputProps['onInput'] = () => {}
1516
1617
const classes = classNames([
1718
styles.input,
@@ -41,10 +42,11 @@
4142
class={classes}
4243
on:change={onChange}
4344
on:keyup={onKeyUp}
45+
on:input={onInput}
4446
{...$$restProps}
4547
/>
4648
</ConditionalWrapper>
47-
{#if label}
49+
{#if subText}
4850
<div class={styles.subtext}>
4951
{@html subText}
5052
</div>

src/components/Input/Input.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const Input = ({
1010
theme,
1111
label,
1212
subText,
13-
icon,
1413
value,
1514
className,
1615
children,

src/components/Input/input.module.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868

6969
svg {
7070
@include position(absolute, l10px);
71-
@include size(20px);
71+
@include size(18px);
72+
@include typography(primary-30);
7273
}
7374
}
7475

src/components/Input/input.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ export type InputProps = {
4141
export type SvelteInputProps = {
4242
onChange?: (e: any) => any
4343
onKeyUp?: (e: any) => any
44+
onInput?: (e: any) => any
4445
} & InputProps
4546

4647
export type ReactInputProps = {
4748
onChange?: (e: any) => any
4849
onKeyUp?: (e: any) => any
50+
onInput?: (e: any) => any
4951
children?: React.ReactNode
5052
} & InputProps

0 commit comments

Comments
 (0)