Skip to content

Commit df17f04

Browse files
authored
Follow up for #1110 (#1112)
* minor fixes and tweaks - Added new command(`file explorer`) to open file manager - Added copy button to code blocks on plugin page - some error logging for debugging - few markdown tweaks * fix: network issue while making request to ipv4, etc * follow up for #1110 to handle lazy loading
1 parent 0d502b9 commit df17f04

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/inputhints/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,11 @@ export default function inputhints($input, hints, onSelect) {
270270
}
271271

272272
function updatePage() {
273+
const offset = (pages + 1) * LIMIT;
274+
const hasMore = offset < currentHints.length;
275+
273276
// if the scroll is at the bottom
274-
if ($ul.scrollTop + $ul.clientHeight >= $ul.scrollHeight) {
277+
if ($ul.scrollTop + $ul.clientHeight >= $ul.scrollHeight && hasMore) {
275278
pages++;
276279
updateUlNow(currentHints, pages);
277280
}
@@ -311,8 +314,11 @@ export default function inputhints($input, hints, onSelect) {
311314

312315
$ul.remove();
313316

314-
if (!list.length) {
317+
if (!hints.length) {
315318
$ul.content = [<Hint hint={{ value: "", text: "No matches found" }} />];
319+
} else if (!list.length) {
320+
// No more hints to load
321+
return;
316322
} else {
317323
if (!page) {
318324
scrollTop = 0;

0 commit comments

Comments
 (0)