Skip to content

Commit

Permalink
fix: fix flicking setter error
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed May 31, 2024
1 parent 40bc122 commit 18c4a74
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ export class NgxFlickingComponent
// Omit 'virtual', as it can't have any setter
for (const key in newOptions) {
if (key in flicking && flicking[key] !== newOptions[key]) {
flicking[key] = newOptions[key];
try {
flicking[key] = newOptions[key];
// eslint-disable-next-line no-empty
} catch (e) {}
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/react-flicking/src/react-flicking/Flicking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ class Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>>
const { virtual, ...props } = this.props;
for (const key in props) {
if (key in flicking && flicking[key] !== props[key]) {
flicking[key] = props[key];
try {
flicking[key] = props[key];
} catch (e) {}
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/svelte-flicking/src/flicking.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
// Omit 'virtual', as it can't have any setter
for (const key in newOptions) {
if (key in vanillaFlicking && vanillaFlicking[key] !== newOptions[key]) {
vanillaFlicking[key] = newOptions[key];
try {
vanillaFlicking[key] = newOptions[key];
} catch (e) {}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion packages/vue-flicking/src/Flicking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ const Flicking = Vue.extend({

for (const key in options) {
if (key in flicking && flicking[key] !== options[key]) {
flicking[key] = options[key];
try {
flicking[key] = options[key];
// eslint-disable-next-line no-empty
} catch (e) {}
}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/vue3-flicking/src/Flicking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ const Flicking = defineComponent({

for (const key in options) {
if (key in flicking && flicking[key] !== options[key]) {
flicking[key] = options[key];
try {
flicking[key] = options[key];
// eslint-disable-next-line no-empty
} catch (e) {}
}
}
},
Expand Down

0 comments on commit 18c4a74

Please sign in to comment.