mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-17 11:29:58 +08:00
Fix gallery select event with custom height and allow_preview=False (#4551)
* Logic for can_zoom * CHANGELOG
This commit is contained in:
parent
b7010fa0eb
commit
98d1e8d291
@ -6,7 +6,7 @@ No changes to highlight.
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
No changes to highlight.
|
||||
- Fix bug where `select` event was not triggered in `gr.Gallery` if `height` was set to be large with `allow_preview=False` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4551](https://github.com/gradio-app/gradio/pull/4551)
|
||||
|
||||
## Other Changes:
|
||||
|
||||
|
@ -130,7 +130,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
$: can_zoom = window_height >= client_height;
|
||||
// If you don't allow preview, assume can always zoom to trigger select event
|
||||
$: can_zoom = !allow_preview ? true : window_height >= client_height;
|
||||
|
||||
let client_height = 0;
|
||||
let window_height = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user