Skip to content

Commit

Permalink
[fix](@svelteui/core): missing pointer events in NumberInput
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #449
  • Loading branch information
BeeMargarida committed Aug 24, 2023
1 parent 35a847b commit 8380ac7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/svelteui-core/src/components/Input/Input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface InputBaseProps<T = string> extends DefaultProps<InputElementTyp
disabled?: boolean;
size?: SvelteUISize;
resize?: CSS['resize'];
noPointerEventsRightSection?: boolean;
root?: Component | keyof HTMLElementTagNameMap;
value?: T;
}
Expand Down
8 changes: 3 additions & 5 deletions packages/svelteui-core/src/components/Input/Input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
type: $$Props['type'] = 'text',
placeholder: $$Props['placeholder'] = undefined,
autofocus: $$Props['autofocus'] = undefined,
resize: $$Props['resize'] = 'none';
resize: $$Props['resize'] = 'none',
noPointerEventsRightSection: $$Props['noPointerEventsRightSection'] = false;
export { className as class };
/** An action that forwards inner dom node events from parent component */
Expand All @@ -47,9 +48,6 @@
function isInput(root: string): root is Input {
return ['input', 'select', 'textarea', 'datalist'].includes(root);
}
function isSelect(root: string): boolean {
return root === 'select';
}
let isHTMLElement = true;
let isComponent = false;
Expand Down Expand Up @@ -231,7 +229,7 @@ Base component to create custom inputs
{#if showRightSection}
<div
{...rightSectionProps}
class={cx(classes.rightSection, { [classes.noPointerEvents]: isSelect(root) })}
class={cx(classes.rightSection, { [classes.noPointerEvents]: noPointerEventsRightSection })}
>
<slot name="rightSection" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Capture user feedback limited to large set of options
autocomplete="off"
invalid={Boolean(error)}
override={{ ...base, ...inputStyle }}
noPointerEventsRightSection
{size}
{icon}
{radius}
Expand Down

0 comments on commit 8380ac7

Please sign in to comment.