fix(ticket): keep file picker out of modal shell to stop dialog offset
The hidden file input was appended to the flex-centered modal shell, becoming a second flex child that pushed the dialog left and exposed the native file button (theme display rules override [hidden]). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3bd15feccb
commit
b927b9ec7c
1 file changed
+2
-2
@@ -276,12 +276,12 @@
|
||||
*/
|
||||
function bindShell(shell, onClick) {
|
||||
var ctx = { uploadRoot: null };
|
||||
// 文件选择器保持脱离文档:shell 是 flex 居中容器,挂进去会成为第二个 flex 子项,
|
||||
// 把对话框挤偏并露出原生「选择文件」按钮(主题样式会覆盖 [hidden])。
|
||||
var input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = IMAGE_ACCEPT;
|
||||
input.multiple = true;
|
||||
input.hidden = true;
|
||||
shell.appendChild(input);
|
||||
input.addEventListener('change', function () {
|
||||
var files = Array.prototype.slice.call(input.files || []);
|
||||
input.value = '';
|
||||
|
||||
Reference in new issue
Block a user