diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts
index 05214010a..ae3c71798 100644
--- a/app/src/protyle/breadcrumb/index.ts
+++ b/app/src/protyle/breadcrumb/index.ts
@@ -430,7 +430,7 @@ export class Breadcrumb {
`;
} else {
- html += `
+ html += `
${item.name}
`;
@@ -446,25 +446,22 @@ export class Breadcrumb {
return;
}
let jump = false;
- while (this.element.scrollHeight > 30 && !jump) {
+ while (this.element.scrollHeight > 30 && !jump && itemElements.length > 1) {
itemElements.find((item, index) => {
- if (itemElements.length === 1) {
- item.classList.add("protyle-breadcrumb__text--ellipsis");
- jump = true;
- return true;
- }
- if (!item.classList.contains("protyle-breadcrumb__text--ellipsis")) {
- item.classList.add("protyle-breadcrumb__text--ellipsis");
- return true;
- }
- if (index === itemElements.length - 1 && item.classList.contains("protyle-breadcrumb__text--ellipsis")) {
- jump = true;
+ if (index > 0) {
+ if (!item.classList.contains("protyle-breadcrumb__text--ellipsis")) {
+ item.classList.add("protyle-breadcrumb__text--ellipsis");
+ return true;
+ }
+ if (index === itemElements.length - 1 && item.classList.contains("protyle-breadcrumb__text--ellipsis")) {
+ jump = true;
+ }
}
});
}
this.element.classList.add("protyle-breadcrumb__bar--nowrap");
if (this.element.lastElementChild) {
- this.element.scrollLeft = (this.element.lastElementChild as HTMLElement).offsetLeft - this.element.clientWidth - 8;
+ this.element.scrollLeft = (this.element.lastElementChild as HTMLElement).offsetLeft - this.element.clientWidth + 14;
}
});
}