Skip to content

Commit

Permalink
Prevent drag and drop for hidden widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
mat007 committed Dec 26, 2023
1 parent ee583ac commit 657e29c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions widget/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,18 @@ func (c *Container) GetFocusers() []Focuser {
}

func (c *Container) GetDropTargets() []HasWidget {
if c.GetWidget().Visibility == Visibility_Hide {
return nil
}

var result []HasWidget
if c.GetWidget().drop != nil {
result = append(result, c)
}
for _, child := range c.children {
if child.GetWidget().Visibility == Visibility_Hide {
continue
}
if v, ok := child.(Dropper); ok {
result = append(result, v.GetDropTargets()...)
}
Expand Down

0 comments on commit 657e29c

Please sign in to comment.