Fix `editor.selectedContainer`

And it is used in a few places in the PR.