Skip to content

Commit 2c49ec2

Browse files
committed
shiftTop only if BOF
1 parent 7764c67 commit 2c49ec2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modules/adapter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ class Adapter {
174174
// try to catch "first" edge case on remove
175175
if (!options.immutableTop && !newItems.length) {
176176
// this is the first item, or the previous one's part of the "shift-top" group
177-
if (position === 0 || this.buffer[position - 1].shiftTop) {
177+
if (
178+
(position === 0 && this.buffer.bof) ||
179+
(position !== 0 && this.buffer[position - 1].shiftTop)
180+
) {
178181
wrapper.shiftTop = true;
179182
}
180183
}

0 commit comments

Comments
 (0)