FIX: keep scroll position when adding first recent emoji
This commit is contained in:
parent
cdefb58018
commit
8c17596aa5
|
@ -86,6 +86,7 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
@observes("recentEmojis")
|
@observes("recentEmojis")
|
||||||
recentEmojisChanged() {
|
recentEmojisChanged() {
|
||||||
|
const previousScrollTop = $list.scrollTop();
|
||||||
const $recentSection = $list.find(".section[data-section='recent']");
|
const $recentSection = $list.find(".section[data-section='recent']");
|
||||||
const $recentSectionGroup = $recentSection.find(".section-group");
|
const $recentSectionGroup = $recentSection.find(".section-group");
|
||||||
const $recentCategory = $picker.find(".category-icon button[data-section='recent']").parent();
|
const $recentCategory = $picker.find(".category-icon button[data-section='recent']").parent();
|
||||||
|
@ -105,6 +106,10 @@ export default Ember.Component.extend({
|
||||||
const template = findRawTemplate("emoji-picker-recent")({recentEmojis});
|
const template = findRawTemplate("emoji-picker-recent")({recentEmojis});
|
||||||
$recentSectionGroup.html(template);
|
$recentSectionGroup.html(template);
|
||||||
this._bindHover($recentSectionGroup);
|
this._bindHover($recentSectionGroup);
|
||||||
|
|
||||||
|
if(this.get("recentEmojis").length === 1) {
|
||||||
|
$list.scrollTop(previousScrollTop + $recentSection.outerHeight());
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
|
Loading…
Reference in New Issue