Skip to content

Commit

Permalink
[fix](@svelteui/core): failing test for Input
Browse files Browse the repository at this point in the history
  • Loading branch information
BeeMargarida committed Jul 28, 2023
1 parent ef64c79 commit c6be295
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions packages/svelteui-core/src/components/Input/Input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,6 @@ Base component to create custom inputs

<!-- svelte-ignore a11y-autofocus -->
<Box {...wrapperProps} class={cx(classes.root, getStyles({ css: override }))} {...$$restProps}>
<!-- @TODO: This is a workaround for current limitations of slot forwarding, see comment above -->
<span bind:this={iconElement} class={cx({ [classes.iconWrapper]: !!icon || isIconSlotUsed })}>
<slot name="icon">
{#if icon}
<div class={classes.icon}>
<IconRenderer {icon} {iconProps} iconSize={16} />
</div>
{/if}
</slot>
</span>
<!-- @TODO: This is a workaround for current limitations of slot forwarding, see comment above -->
{#if icon && !isIconSlotUsed}
<div class={cx(classes.icon, classes.iconWrapper)}>
<IconRenderer {icon} {iconProps} iconSize={16} />
</div>
{/if}

{#if isHTMLElement && root === 'input'}
<input
{value}
Expand Down Expand Up @@ -225,6 +208,22 @@ Base component to create custom inputs
<slot />
</svelte:component>
{/if}
<!-- @TODO: This is a workaround for current limitations of slot forwarding, see comment above -->
<span bind:this={iconElement} class={cx({ [classes.iconWrapper]: !!icon || isIconSlotUsed })}>
<slot name="icon">
{#if icon}
<div class={classes.icon}>
<IconRenderer {icon} {iconProps} iconSize={16} />
</div>
{/if}
</slot>
</span>
<!-- @TODO: This is a workaround for current limitations of slot forwarding, see comment above -->
{#if icon && $$slots.icon && !isIconSlotUsed}
<div class={cx(classes.icon, classes.iconWrapper)}>
<IconRenderer {icon} {iconProps} iconSize={16} />
</div>
{/if}
{#if showRightSection}
<div {...rightSectionProps} class={classes.rightSection}>
<slot name="rightSection" />
Expand Down

0 comments on commit c6be295

Please sign in to comment.