motiondivision / motiondivision/motion

[BUG] Reorder.Item transfrom Y is not working correctly when container height is changed

Open
#2,255 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
33.7k
Forks
1.4k
Avg merge
1d 10h
Merged PRs (30d)
14

Description

issue video

https://github.com/framer/motion/assets/49806316/78f81e24-2b3b-47db-9b82-97f3394a5c64

.
.

Reorder.Item /> style when bug occurs

스크린샷 2023-07-26 오후 1 59 11 . .

.
.

<Reorder.Group
  axis="x"
  values={selectData}
  onReorder={(newOrder) => {
    onChange(newOrder)
  }}
  className=""
>
  {selectData.map((data, index: number) => {
    return (
      <Reorder.Item
          ref={ref}
          key={index}
          value={data}
          className="cursor-pointer"
      >
          <li
            key={key}
            className="..."
          >
            {data}
          <button
            className="..."
            onClick={() => {
              onClick(data);
            }}
          >
              <CloseIcon className="..." />
          </button>
        </li>
      </Reorder.Item>
      );
  })}
</Reorder.Group>

.
.
I tried to many way to solve problem like onAnimationEnd props, onMouseUp props, useMotionValue and
useRef ...

FYI, transformTemplate is solution. but not exactly. because It looked as if the x-axis movement animation was being omitted.

i think this issue occurred only in changeable containers

i want to fixed transform Y to 0

how can i solve it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with the provided Reorder.Group and Reorder.Item example while changing the container height, then trace the Reorder.Item transform and layout-animation entry points. Done means the Y transform remains 0 during container-height changes while the X-axis reorder animation still runs correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.