Skip to content

Commit 8380ac7

Browse files
committed
[fix](@svelteui/core): missing pointer events in NumberInput
ISSUES CLOSED: #449
1 parent 35a847b commit 8380ac7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/svelteui-core/src/components/Input/Input.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface InputBaseProps<T = string> extends DefaultProps<InputElementTyp
2626
disabled?: boolean;
2727
size?: SvelteUISize;
2828
resize?: CSS['resize'];
29+
noPointerEventsRightSection?: boolean;
2930
root?: Component | keyof HTMLElementTagNameMap;
3031
value?: T;
3132
}

packages/svelteui-core/src/components/Input/Input.svelte

+3-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
type: $$Props['type'] = 'text',
3434
placeholder: $$Props['placeholder'] = undefined,
3535
autofocus: $$Props['autofocus'] = undefined,
36-
resize: $$Props['resize'] = 'none';
36+
resize: $$Props['resize'] = 'none',
37+
noPointerEventsRightSection: $$Props['noPointerEventsRightSection'] = false;
3738
export { className as class };
3839
3940
/** An action that forwards inner dom node events from parent component */
@@ -47,9 +48,6 @@
4748
function isInput(root: string): root is Input {
4849
return ['input', 'select', 'textarea', 'datalist'].includes(root);
4950
}
50-
function isSelect(root: string): boolean {
51-
return root === 'select';
52-
}
5351
let isHTMLElement = true;
5452
let isComponent = false;
5553
@@ -231,7 +229,7 @@ Base component to create custom inputs
231229
{#if showRightSection}
232230
<div
233231
{...rightSectionProps}
234-
class={cx(classes.rightSection, { [classes.noPointerEvents]: isSelect(root) })}
232+
class={cx(classes.rightSection, { [classes.noPointerEvents]: noPointerEventsRightSection })}
235233
>
236234
<slot name="rightSection" />
237235
</div>

packages/svelteui-core/src/components/NativeSelect/NativeSelect.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Capture user feedback limited to large set of options
9494
autocomplete="off"
9595
invalid={Boolean(error)}
9696
override={{ ...base, ...inputStyle }}
97+
noPointerEventsRightSection
9798
{size}
9899
{icon}
99100
{radius}

0 commit comments

Comments
 (0)