Skip to content

Commit

Permalink
APP-6309: restrict text in Firefox in <RestrictedText> input (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous authored Sep 20, 2024
1 parent 486bfac commit d4d639a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@viamrobotics/prime-core",
"version": "0.0.153",
"version": "0.0.154",
"repository": {
"type": "git",
"url": "https://github.com/viamrobotics/prime.git",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/input/input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ $: errorClasses =
errorClasses,
extraClasses
)}
bind:value
bind:this={input}
on:input
on:input|capture={handleDisabled}
on:change
Expand All @@ -96,6 +94,8 @@ $: errorClasses =
on:keydown|capture={handleDisabledKeydown}
on:focus
on:blur
bind:value
bind:this={input}
/>

{#if icon}
Expand Down
13 changes: 8 additions & 5 deletions packages/core/src/lib/input/restricted-text-input.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
@component
For text-based user inputs that only allow certain characters. Shows the user a tooltip when they attempt to use disallowed characters.
Expand All @@ -15,11 +15,13 @@ For text-based user inputs that only allow certain characters. Shows the user a
```
-->
<script lang="ts">
import type cx from 'classnames';
import { TextInput } from '$lib';
import cx from 'classnames';
import { Tooltip, type TooltipVisibility } from '$lib/tooltip';
import { useTimeout } from '$lib/use-timeout';
import Input from './input.svelte';
/** The value of the input. */
export let value: string;
Expand Down Expand Up @@ -85,11 +87,12 @@ $: tooltipVisibility = validationState === 'hide' ? 'invisible' : 'visible';
let:tooltipID
>
<p slot="description">{tooltipDescription}</p>
<TextInput
<Input
type="text"
cx={inputCX}
aria-describedby={tooltipID}
{value}
on:input={handleInput}
{value}
{...$$restProps}
/>
</Tooltip>
4 changes: 2 additions & 2 deletions packages/core/src/lib/input/text-input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export { extraClasses as cx };
cx={extraClasses}
{type}
{...$$restProps}
bind:value
bind:input
on:input
on:change
on:keydown
on:focus
on:blur
bind:value
bind:input
/>

0 comments on commit d4d639a

Please sign in to comment.