Et2VfsPath: Make sure there's enough space for right scroll button

This commit is contained in:
nathan 2024-04-12 10:18:25 -06:00
parent 15eab33bfb
commit a3835de82f
3 changed files with 8 additions and 6 deletions

View File

@ -68,6 +68,11 @@ export default css`
min-width: 10em; min-width: 10em;
} }
.vfs-path__overflow .vfs-path__scroll {
min-width: 8em;
margin-right: 2em;
}
.form-control-input sl-icon-button[name*="caret"] { .form-control-input sl-icon-button[name*="caret"] {
display: none; display: none;
position: absolute; position: absolute;

View File

@ -154,17 +154,14 @@ export class Et2VfsPath extends Et2InputWidget(LitElement)
{ {
return; return;
} }
wrapper.parentElement.classList.remove("vfs-path__overflow");
path.updateComplete.then(() => path.updateComplete.then(() =>
{ {
if(wrapper.clientWidth < scroll.scrollWidth) if(wrapper.clientWidth < scroll.scrollWidth)
{ {
// Too small // Too small
wrapper.scrollLeft = scroll.scrollWidth - wrapper.clientWidth;
wrapper.parentElement.classList.add("vfs-path__overflow"); wrapper.parentElement.classList.add("vfs-path__overflow");
} wrapper.scrollLeft = scroll.scrollWidth - wrapper.clientWidth;
else
{
wrapper.parentElement.classList.remove("vfs-path__overflow");
} }
}); });
} }

View File

@ -37,7 +37,7 @@ input#filemanager-index_path {
/* Let path have more space */ /* Let path have more space */
#filemanager-index_filemanager-index-header_row { #filemanager-index_filemanager-index-header_row {
flex: 20 1 auto; flex: 20 1 auto;
min-width: 20em; min-width: 24em;
} }
#filemanager-index_nm_path { #filemanager-index_nm_path {