Fix slider released event not triggering when released on mobile (#4098)

* Fix slider released event not triggering when released on mobile

* Update CHANGELOG

* fix range test

* retrigger

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
space-nuko 2023-05-08 21:10:26 -05:00 committed by GitHub
parent 5ef0bfeefc
commit fab7642414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1682 additions and 1448 deletions

View File

@ -12,6 +12,7 @@
- Fixed bug where type hints in functions caused the event handler to crash by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4068](https://github.com/gradio-app/gradio/pull/4068)
- Fix dropdown default value not appearing by [@aliabid94](https://github.com/aliabid94) in [PR 4072](https://github.com/gradio-app/gradio/pull/4072).
- Soft theme label color fix by [@aliabid94](https://github.com/aliabid94) in [PR 4070](https://github.com/gradio-app/gradio/pull/4070)
- Fix `gr.Slider` `release` event not triggering on mobile by [@space-nuko](https://github.com/space-nuko) in [PR 4098](https://github.com/gradio-app/gradio/pull/4098)
- Removes extraneous `State` component info from the `/info` route by [@abidlabs](https://github.com/freddyaboulton) in [PR 4107](https://github.com/gradio-app/gradio/pull/4107)
## Documentation Changes:

View File

@ -43,7 +43,7 @@
on:blur={clamp}
{step}
{disabled}
on:mouseup={handle_release}
on:pointerup={handle_release}
/>
</div>
</div>
@ -57,7 +57,7 @@
max={maximum}
{step}
{disabled}
on:mouseup={handle_release}
on:pointerup={handle_release}
/>
<style>

View File

@ -6,7 +6,7 @@ import Range from "./Range.svelte";
describe("Range", () => {
afterEach(() => cleanup());
test("Release event called on blur and mouseUp", () => {
test("Release event called on blur and pointerUp", () => {
const results = render(Range, {
label: "range",
show_label: true,
@ -19,7 +19,7 @@ describe("Range", () => {
const mock = vi.fn();
results.component.$on("release", mock);
fireEvent.mouseUp(numberInput);
fireEvent.pointerUp(numberInput);
expect(mock).toHaveBeenCalledOnce();

File diff suppressed because it is too large Load Diff