Skip to content

Commit

Permalink
Merge pull request #302 from maxfordham/299-nullable-array-not-appear…
Browse files Browse the repository at this point in the history
…ing-within-form

🐛 Fix display issue of nested widgets with nullable
  • Loading branch information
ollyhensby authored Mar 21, 2024
2 parents 6be1f4c + e986b9a commit 2ee81a4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ipyautoui/autoobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ def observe_show_null(self, on_change):
def _show_null(self, yesno: bool):
for k, v in self.di_boxes.items():
if k in self.value.keys():
if not isinstance(self.value[k], (dict, list)):
if pd.isnull(self.value[k]):
v.layout.display = (lambda yesno: "" if yesno else "None")(yesno)
else:
v.layout.display = ""
if self.value[k] is None:
v.layout.display = (lambda yesno: "" if yesno else "None")(yesno)
else:
v.layout.display = ""
else:
# If no value passed assume value is None
v.layout.display = (lambda yesno: "" if yesno else "None")(yesno)
Expand Down

0 comments on commit 2ee81a4

Please sign in to comment.