Fixes data updating invoke the select event (#3861)

* fix data updating invoke the `select` event

* Update CHANGELOG.md

* changes

* change

* change

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Ali Abid <aabid94@gmail.com>
This commit is contained in:
January Desk 2023-04-24 09:33:40 +08:00 committed by GitHub
parent ad2ed23ce0
commit 7b0f48eb2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -190,6 +190,7 @@ No changes to highlight.
## Bug Fixes:
- Fixes Chatbot issue where new lines were being created every time a message was sent back and forth by [@aliabid94](https://github.com/aliabid94) in [PR 3717](https://github.com/gradio-app/gradio/pull/3717).
- Fixes data updating in DataFrame invoking a `select` event once the dataframe has been selected. By [@yiyuezhuo](https://github.com/yiyuezhuo) in [PR 3861](https://github.com/gradio-app/gradio/pull/3861)
- Fixes false postive warning which is due to too strict type checking by [@yiyuezhuo](https://github.com/yiyuezhuo) in [PR 3837](https://github.com/gradio-app/gradio/pull/3837).
## Documentation Changes:

View File

@ -44,12 +44,14 @@
}>();
let editing: false | string = false;
const get_data_at = (row: number, col: number) => data[row][col].value;
$: {
if (selected !== false) {
const loc = selected.split("-");
const row = parseInt(loc[0]);
const col = parseInt(loc[1]);
dispatch("select", { index: [row, col], value: data[row][col].value });
dispatch("select", { index: [row, col], value: get_data_at(row, col) });
}
}
let els: Record<