Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG]: default handle styles don't correctly adjust handle positions to center on borders if handle size is changed #690

Closed
1 task done
snoozbuster opened this issue Feb 17, 2023 · 7 comments · Fixed by #1235 · May be fixed by #717
Closed
1 task done
Assignees
Labels
bug Something isn't working refactor Refactor existing features

Comments

@snoozbuster
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues and this is a new bug.

Current Behavior

Handles are only centered on the edges of the nodes if the handles size are not changed

Expected Behavior

Handles are centered on the edges of the nodes regardless of the size of the handle

Steps To Reproduce

set up VueFlow with the additional style

.vue-flow__handle {
  height: 10px;
  width: 10px;
}

Observe that handles are no longer centered on the edges of the nodes.

Relevant log output

No response

Anything else?

the handle styles are all hard-coded to adjust handles by -4px in the opposite direction, instead of using translate. For example, code like this works (to my knowledge) for all sizes of handle:

.vue-flow__handle {
  /* set some width and height... */

  &-bottom {
    bottom: 0;
    transform: translate(-50%, 50%);
  }

  &-top {
    top: 0;
    transform: translate(-50%, -50%);
  }

  &-left {
    left: 0;
    transform: translate(-50%, -50%);
  }

  &-right {
    right: 0;
    transform: translate(50%, -50%);
  }
}

I would have just opened this PR myself but I'm not familiar enough with the various styles and configuration options to be sure that this doesn't break something I haven't discovered.

@snoozbuster snoozbuster added bug Something isn't working triage Awaiting triage labels Feb 17, 2023
@bcakmakoglu
Copy link
Owner

Thanks for the report, I'll see what can be done :)

@bcakmakoglu bcakmakoglu added refactor Refactor existing features and removed triage Awaiting triage labels Feb 17, 2023
@bcakmakoglu
Copy link
Owner

As this kinda constitutes a breaking change, I will hold off releasing the PR for this until the release of 2.0.0, which might happen rather soon than later. Until then you'll have to overwrite the styles.

@bcakmakoglu bcakmakoglu linked a pull request Feb 24, 2023 that will close this issue
4 tasks
@bcakmakoglu
Copy link
Owner

@snoozbuster
FYI: Will do a pre-release/beta soon for 2.0.0. Should be by the end of this month but can't make any promises 😄

@snoozbuster
Copy link
Contributor Author

hey @bcakmakoglu. Long time no chat. I am wondering if waiting for a major version release for this is really necessary given this more significant breaking change introduced in a minor version, and this quite significant breaking change introduced in a patch version. By comparison, this is much less breaking than either of those changes.

@bcakmakoglu
Copy link
Owner

I'll probably add it earlier since 2.0.0 will take a while do finish.

@bcakmakoglu
Copy link
Owner

I'll put this into 1.29.0 probably ^^

@bcakmakoglu bcakmakoglu linked a pull request Jan 21, 2024 that will close this issue
@bcakmakoglu
Copy link
Owner

Fixed in 1.29.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor Refactor existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants