mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
Clamps values for typeable slider input when out of range (#2380)
* warning for slider type input * fix value on blur * remove unnecesary classes * update changelog * Update CHANGELOG.md
This commit is contained in:
parent
a03d0ebe7c
commit
b59c45160d
@ -53,6 +53,7 @@ No changes to highlight.
|
|||||||
* Copy changelog file in website docker by [@aliabd](https://github.com/aliabd) in [PR 2384](https://github.com/gradio-app/gradio/pull/2384)
|
* Copy changelog file in website docker by [@aliabd](https://github.com/aliabd) in [PR 2384](https://github.com/gradio-app/gradio/pull/2384)
|
||||||
* Lets users provide a `gr.update()` dictionary even if post-processing is diabled [@abidlabs](https://github.com/abidlabs) in [PR 2385](https://github.com/gradio-app/gradio/pull/2385)
|
* Lets users provide a `gr.update()` dictionary even if post-processing is diabled [@abidlabs](https://github.com/abidlabs) in [PR 2385](https://github.com/gradio-app/gradio/pull/2385)
|
||||||
* Fix bug where errors would cause apps run in reload mode to hang forever by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2394](https://github.com/gradio-app/gradio/pull/2394)
|
* Fix bug where errors would cause apps run in reload mode to hang forever by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2394](https://github.com/gradio-app/gradio/pull/2394)
|
||||||
|
* Fix bug where new typeable slider doesn't respect the minimum and maximum values [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 2380](https://github.com/gradio-app/gradio/pull/2380)
|
||||||
|
|
||||||
## Contributors Shoutout:
|
## Contributors Shoutout:
|
||||||
No changes to highlight.
|
No changes to highlight.
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
const dispatch = createEventDispatcher<{ change: number }>();
|
const dispatch = createEventDispatcher<{ change: number }>();
|
||||||
|
|
||||||
$: dispatch("change", value);
|
$: dispatch("change", value);
|
||||||
|
const clamp = () => (value = Math.min(Math.max(value, minimum), maximum));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="w-full flex flex-col ">
|
<div class="w-full flex flex-col ">
|
||||||
@ -34,6 +35,7 @@
|
|||||||
bind:value
|
bind:value
|
||||||
min={minimum}
|
min={minimum}
|
||||||
max={maximum}
|
max={maximum}
|
||||||
|
on:blur={clamp}
|
||||||
{step}
|
{step}
|
||||||
{disabled}
|
{disabled}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user