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

🐛 EditGrid: Only pass necessary kwargs #354

Merged
merged 1 commit into from
Jan 13, 2025
Merged
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
12 changes: 8 additions & 4 deletions src/ipyautoui/custom/editgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

from ipyautoui.autoobject import AutoObjectForm
from ipyautoui.custom.buttonbars import CrudButtonBar
from ipyautoui._utils import frozenmap
from ipyautoui._utils import frozenmap, traits_in_kwargs
from ipyautoui.constants import BUTTON_WIDTH_MIN
from ipyautoui.custom.autogrid import AutoGrid
from ipyautoui.custom.title_description import TitleDescription
Expand Down Expand Up @@ -336,9 +336,13 @@ def __init__(
self._init_form()
self._init_row_controls()
self._init_controls()
# NOTE: setting kwargs here and in _init_autogrid may cause unwanted behaviour
# PR: https://github.com/maxfordham/ipyautoui/pull/351
super().__init__(**kwargs)
super().__init__(
**{
k: v
for k, v in kwargs.items()
if k not in traits_in_kwargs(AutoGrid, kwargs)
}
) # NOTE: Only pass kwargs not in AutoGrid traits
self.warn_on_delete = warn_on_delete
# self.show_copy_dialogue = show_copy_dialogue
self.show_copy_dialogue = False
Expand Down
Loading