Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ app/static/**/*.css
*.swo
.DS_Store

# Environment variables
# Environment variables and local files
.env
.env.local
.env.*.local
**/*.local

# Debug logs
debug/
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ members = [
[workspace.package]

# Current release version.
version = "0.2.0"
version = "0.2.1"

# Rust edition for language and compiler features.
edition = "2024"
Expand All @@ -47,8 +47,8 @@ rust-version = "1.85"
# Both `path` (for local development) and `version` (for crates.io resolution)
# are specified so that `cargo publish` resolves the dependency from the registry
# while local builds use the workspace path.
yew-datatable-core = { path = "./yew-datatable-core", version = "0.2.0" }
yew-datatable = { path = "./yew-datatable", version = "0.2.0" }
yew-datatable-core = { path = "./yew-datatable-core", version = "0.2.1" }
yew-datatable = { path = "./yew-datatable", version = "0.2.1" }

# Yew framework for WebAssembly frontend development.
yew = { version = "0.23.0", features = ["csr"] }
Expand Down
10 changes: 5 additions & 5 deletions yew-datatable/src/components/table_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ pub struct TableBodyProps<T: Clone + PartialEq + 'static> {

/// Compares `TableBodyProps` by all fields, including the table handle.
///
/// The `render_cell` callback is always treated as changed when present,
/// since `Callback` does not implement `PartialEq`.
/// The `render_cell` callback is compared through `Callback`'s `PartialEq`,
/// which is pointer equality on the inner `Rc`, so the body memoizes
/// correctly and re-renders only when the callback identity changes.
impl<T: Clone + PartialEq + 'static> PartialEq for TableBodyProps<T> {
fn eq(&self, other: &Self) -> bool {
// Compare the table handle for reactivity-aware equality.
Expand All @@ -49,9 +50,8 @@ impl<T: Clone + PartialEq + 'static> PartialEq for TableBodyProps<T> {
&& self.td_class == other.td_class
&& self.selected_class == other.selected_class
&& self.selectable == other.selectable
// Callbacks cannot be compared; assume changed if either side has one.
&& self.render_cell.is_none()
&& other.render_cell.is_none()
// Compare the cell renderer by callback pointer equality.
&& self.render_cell == other.render_cell
}
}

Expand Down
Loading