Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert editable text changes #10540

Merged
merged 6 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions js/dataframe/shared/Table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@
header_edit = false;

selected_cells = handle_selection([row, col], selected_cells, event);
parent.focus();

if (selected_cells.length === 1 && editable) {
editing = [row, col];
Expand Down Expand Up @@ -999,7 +1000,6 @@
<td
tabindex={show_row_numbers && j === 0 ? -1 : 0}
on:touchstart={(event) => {
if (!editable) return;
const touch = event.touches[0];
const mouseEvent = new MouseEvent("click", {
clientX: touch.clientX,
Expand All @@ -1011,17 +1011,12 @@
handle_cell_click(mouseEvent, index, j);
}}
on:mousedown={(event) => {
if (!editable) return;
event.preventDefault();
event.stopPropagation();
}}
on:click={(event) => {
if (!editable) return;
handle_cell_click(event, index, j);
}}
on:click={(event) => handle_cell_click(event, index, j)}
style:width="var(--cell-width-{j})"
style={styling?.[index]?.[j] || ""}
class:not-editable={!editable}
class={is_cell_selected([index, j], selected_cells)}
class:menu-active={active_cell_menu &&
active_cell_menu.row === index &&
Expand Down Expand Up @@ -1437,19 +1432,4 @@
.cell-selected.no-top.no-bottom.no-left.no-right {
box-shadow: none;
}

.not-editable {
user-select: text;
cursor: text;
}

.not-editable .cell-wrap {
pointer-events: none;
}

.not-editable :global(.editable-cell) {
pointer-events: auto;
user-select: text;
cursor: text;
}
</style>
8 changes: 0 additions & 8 deletions js/dataframe/shared/utils/table_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,6 @@ export function make_headers(
});
}

export function get_data_at(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isnt being used so I've also removed this

data: TableData,
row: number,
col: number
): string | number | undefined {
return data?.[row]?.[col]?.value;
}

export function get_max(data: TableData): TableCell[] {
if (!data || !data.length) return [];
return data[0];
Expand Down
Loading