Skip to content

Commit

Permalink
Add interpolation locations to infinite scroll examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjerleke committed Jul 18, 2024
1 parent 2c0c528 commit 8d4f51d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ const EmblaCarousel = (props) => {

emblaApi.reInit()
const newEngine = emblaApi.internalEngine()
const copyEngineModules = ['location', 'target', 'scrollBody']
const copyEngineModules = [
'scrollBody',
'location',
'offsetLocation',
'previousLocation',
'target'
]
copyEngineModules.forEach((engineModule) => {
Object.assign(newEngine[engineModule], oldEngine[engineModule])
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ const EmblaCarousel: React.FC<PropType> = (props) => {
emblaApi.reInit()
const newEngine = emblaApi.internalEngine()
const copyEngineModules: (keyof EngineType)[] = [
'scrollBody',
'location',
'target',
'scrollBody'
'offsetLocation',
'previousLocation',
'target'
]
copyEngineModules.forEach((engineModule) => {
Object.assign(newEngine[engineModule], oldEngine[engineModule])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ const EmblaCarousel: React.FC<PropType> = (props) => {
emblaApi.reInit()
const newEngine = emblaApi.internalEngine()
const copyEngineModules: (keyof EngineType)[] = [
'scrollBody',
'location',
'target',
'scrollBody'
'offsetLocation',
'previousLocation',
'target'
]
copyEngineModules.forEach((engineModule) => {
Object.assign(newEngine[engineModule], oldEngine[engineModule])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ export const setupInfiniteScroll = (emblaApi, loadMoreCallback) => {

emblaApi.reInit()
const newEngine = emblaApi.internalEngine()
const copyEngineModules = ['scrollBody', 'location', 'target']
const copyEngineModules = [
'scrollBody',
'location',
'offsetLocation',
'previousLocation',
'target'
]
copyEngineModules.forEach((engineModule) =>
Object.assign(newEngine[engineModule], oldEngine[engineModule])
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export const setupInfiniteScroll = (
const copyEngineModules: (keyof EngineType)[] = [
'scrollBody',
'location',
'offsetLocation',
'previousLocation',
'target'
]
copyEngineModules.forEach((engineModule) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export const setupInfiniteScroll = (
const copyEngineModules: (keyof EngineType)[] = [
'scrollBody',
'location',
'offsetLocation',
'previousLocation',
'target'
]
copyEngineModules.forEach((engineModule) =>
Expand Down

0 comments on commit 8d4f51d

Please sign in to comment.