-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(carousel): remvoed flickering (#2211)
- Loading branch information
Showing
3 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ebay/ebayui-core": patch | ||
--- | ||
|
||
fix(carousel): removed flickering from controlled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/components/ebay-carousel/examples/discrete-controlled.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
export interface Input { | ||
items: number; | ||
index: number; | ||
itemsPerSlide: number; | ||
gap: number; | ||
a11yPreviousText: string; | ||
a11yNextText: string; | ||
} | ||
|
||
export interface State { | ||
index?: number; | ||
} | ||
|
||
class { | ||
onCreate() { | ||
this.state = { | ||
index: 0 | ||
} | ||
} | ||
onMove({visibleIndexes}) { | ||
this.state.index = visibleIndexes[0]; | ||
} | ||
} | ||
|
||
<style> | ||
.demo2-card { | ||
color: #cdf4fd; | ||
background: #a1208b; | ||
font-size: 36px; | ||
font-weight: bold; | ||
height: 330px; | ||
line-height: 330px; | ||
text-align: center; | ||
} | ||
</style> | ||
|
||
<ebay-carousel | ||
...input | ||
index=state.index | ||
itemsPerSlide=(input.itemsPerSlide || 2) | ||
on-next("emit", "next") | ||
on-previous("emit", "previous") | ||
on-move("onMove")> | ||
<@item style={ width: 400 } class="demo2-card">Card 1</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 2</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 3</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 4</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 5</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 6</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 7</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 8</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 9</@item> | ||
<@item style={ width: 400 } class="demo2-card">Card 10</@item> | ||
</ebay-carousel> |