From fdcfb4e9fff3a307093dc6a69cd229c9fa3a6446 Mon Sep 17 00:00:00 2001
From: Christina Toegl <toegl@tugraz.at>
Date: Fri, 11 Feb 2022 16:32:07 +0100
Subject: [PATCH] Fix textfield width

---
 .../file-handling/src/nextcloud-file-picker.js     | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/packages/file-handling/src/nextcloud-file-picker.js b/packages/file-handling/src/nextcloud-file-picker.js
index d228d9e8..f365ab95 100644
--- a/packages/file-handling/src/nextcloud-file-picker.js
+++ b/packages/file-handling/src/nextcloud-file-picker.js
@@ -1948,6 +1948,11 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
                     i18n.t('nextcloud-file-picker.new-folder-placeholder') +
                     '" />';
 
+                let mimeElement = that._('#new-folder-row').querySelector('div.tabulator-cell[tabulator-field="mime"]');
+                if (window.getComputedStyle(mimeElement).display === "none") {
+                    that._('#tf-new-folder').classList.add('smaller');
+                }
+
                 const icon_tag = that.getScopedTagName("dbp-icon");
                 let html = `<${icon_tag} name="checkmark-circle" class="new-folder-checkmark-icon"></${icon_tag}>`;
                 that._('#new-folder-row').innerHTML  += '<button class="button" title="" id="new-folder-row-btn">' + html + '</button>';
@@ -2612,8 +2617,6 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
                 /* font-weight: 300; */
                 border: none;
                 background: transparent;
-                /** width: 100%; */
-                width: calc(100% - 42px);
                 height: 100%;
             }
 
@@ -2650,13 +2653,16 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
             input[type='text']#tf-new-folder {
                 border: 0px;
                 background: transparent;
-                /**width: 100%;*/
-                width: calc(100% - 42px);
+                width: 100%;
                 height: 100%;
                 margin-left: -8px;
                 color: white;
             }
 
+            input[type='text']#tf-new-folder.smaller {
+                width: calc(100% - 42px);
+            }
+
             .new-folder-selected::after {
                 filter: invert(100%);
             }
-- 
GitLab