unselectRegion(tryToKeepStates = false) {
      const annotation = self.annotation;
      const parent = self.parent;
      const keepStates = tryToKeepStates && self.store.settings.continuousLabeling;

      if (annotation.isLinkingMode) {
        annotation.stopLinkingMode();
      }
      if (parent.setSelected) {
        parent.setSelected(undefined);
      }

      self.selected = false;
      annotation.setHighlightedNode(null);

      self.afterUnselectRegion();

      if (!keepStates) {
        annotation.unloadRegionState(self);
      }
    }
Common logic for unselection; specific actions should be in `afterUnselectRegion`
@param {boolean} tryToKeepStates try to keep states selected if such settings enabled