Correct GridSpec override behavior #748
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #514 .
Removed the 'warn' mode to keep only 'error' and 'override'.
'override' behavior now correctly removes the pre-existing Panel.
WIP since the object deletion feels like a kludge and an additional latent bug was noticed during 'error' behavior resulting from line 937-945.
https://github.com/kleavor/panel/blob/a5dff2e30cc08eee713d18ff6ac06d2f20e65c25/panel/layout.py#L937-L945
The if-statement on
overlap
only evaluates to true if the location of the new Panel object exactly matches the location of the conflicting Panel object. In the case of the example provided in the Issue, neither of the new panels matches the "Initial" Panel exactly, and the new object is still added despite erroring, since the error is not raised until the end of the method.Behavior can be observed in a notebook with the following cells
The following cell will raise an Exception.
This cell will show that the state of the gs object now still contains the MultiSelect object despite erroring.