message: refactor(connection-valid): handle source-source, target-target
diff: @@ -46,13 +46,6 @@ export function checkElementBelowIsValid(
  if (elementBelow && (elementBelowIsTarget || elementBelowIsSource)) {
  result.isHoveringHandle = true;
  - // in strict mode we don't allow target to target or source to source connections
  - const isValid =
  - connectionMode === ConnectionMode.Strict
  - ? (isTarget && elementBelowIsSource) || (!isTarget && elementBelowIsTarget)
  - : true;
  -
  - if (isValid) {
  const elementBelowNodeId = elementBelow.getAttribute('data-nodeid');
  const elementBelowHandleId = elementBelow.getAttribute('data-handleid');
  const connection: Connection = isTarget
  @@ -70,6 +63,14 @@ export function checkElementBelowIsValid(
  };
  result.connection = connection;
  +
  + // in strict mode we don't allow target to target or source to source connections
  + const isValid =
  + connectionMode === ConnectionMode.Strict
  + ? (isTarget && elementBelowIsSource) || (!isTarget && elementBelowIsTarget)
  + : true;
  +
  + if (isValid) {
  result.isValid = isValidConnection(connection);
  }
  }
  @@ -151,9 +152,7 @@ export function handleMouseDown(
  return resetRecentHandle(recentHoveredHandle);
  }
  - const isOwnHandle = connection.source === connection.target;
  -
  - if (!isOwnHandle && elementBelow) {
  + if (connection.source !== connection.target && elementBelow) {
  recentHoveredHandle = elementBelow;
  elementBelow.classList.add('react-flow__handle-connecting');
  elementBelow.classList.toggle('react-flow__handle-valid', isValid);
  