Skip to content

Commit

Permalink
RC #291 - Updating FacetTimeline to calculate popover offset on load
Browse files Browse the repository at this point in the history
  • Loading branch information
dleadbetter committed Aug 14, 2024
1 parent 1d790a1 commit ee59801
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core-data/src/components/FacetTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ const FacetTimeline = (props: Props) => {
const onLoad = useCallback((data) => {
setEvents(_.map(data.events, (event) => ({
...event,
year: getYear(event)
year: getYear(event),
offset: Numbers.getRandomInt(-30, 10)
})));
}, []);

Expand Down Expand Up @@ -292,7 +293,7 @@ const FacetTimeline = (props: Props) => {
right: 20,
bottom: 10
}}
sideOffset={Numbers.getRandomInt(-30, 10)}
sideOffset={event.offset}
side='top'
>
<button
Expand Down

0 comments on commit ee59801

Please sign in to comment.