Skip to content

Commit

Permalink
[HOTFIX]: timeline widget - active item (#154)
Browse files Browse the repository at this point in the history
## Description

## Definition of Done

1. [ ] Acceptance criteria are met.
2. [x] PR is manually tested before the merge by developer(s).
    - [x] Happy path is manually checked.
3. [ ] PR is manually tested by QA when their assistance is required
(1).
- [ ] Octant Areas & Test Cases are checked for impact and updated if
required (2).
4. [ ] Unit tests are added unless there is a reason to omit them.
5. [ ] Automated tests are added when required.
6. [x] The code is merged.
7. [ ] Tech documentation is added / updated, reviewed and approved
(including mandatory approval by a code owner, should such exist for
changed files).
    - [ ] BE: Swagger documentation is updated.
8. [ ] When required by QA:
    - [ ] Deployed to the relevant environment.
    - [ ] Passed system tests.

---

(1) Developer(s) in coordination with QA decide whether it's required.
For small tickets introducing small changes QA assistance is most
probably not required.

(2) [Octant Areas & Test
Cases](https://docs.google.com/spreadsheets/d/1cRe6dxuKJV3a4ZskAwWEPvrFkQm6rEfyUCYwLTYw_Cc).
  • Loading branch information
jmikolajczyk authored Apr 16, 2024
2 parents 942d5f9 + 626d5a9 commit a5e0671
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ProjectsTimelineWidget = (): ReactElement => {
const { left: containerLeft, width: containerWidth } =
constraintsRef.current!.getBoundingClientRect();
const { width: milestonesWrapperWidth } = milestonesWrapperRef.current!.getBoundingClientRect();
const xMotionValue = elLeft > containerLeft ? -elLeft + containerLeft : 0;
const xMotionValue = x.get() + (elLeft > containerLeft ? -elLeft + containerLeft : 0);
const maxXValue = milestonesWrapperWidth - containerWidth;

x.set(xMotionValue < -maxXValue ? -maxXValue : xMotionValue);
Expand All @@ -58,6 +58,8 @@ const ProjectsTimelineWidget = (): ReactElement => {
if (!milestonesWrapperRef.current) {
return;
}
setXValue();

const resizeObserver = new ResizeObserver(() => {
if (!isInitialResizeDone) {
isInitialResizeDone = true;
Expand Down

0 comments on commit a5e0671

Please sign in to comment.