mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-07-06 09:30:01 +02:00
Set the dropdown width only when the dropdown is opened, to fix a bug where it would get set before the DOM element actually rendered. The settings field is collapsed by default (on new installations), so the computed DOM width would be invalid
This commit is contained in:
@ -509,8 +509,11 @@ class ModelDropdown
|
|||||||
this.modelList.addEventListener('mousemove', this.bind(this.highlightModelAtPosition, this))
|
this.modelList.addEventListener('mousemove', this.bind(this.highlightModelAtPosition, this))
|
||||||
this.modelList.addEventListener('mousedown', this.bind(this.processClick, this))
|
this.modelList.addEventListener('mousedown', this.bind(this.processClick, this))
|
||||||
|
|
||||||
let modelFilterStyle = window.getComputedStyle(this.modelFilter)
|
let mf = this.modelFilter
|
||||||
rootModelList.style.minWidth = modelFilterStyle.width
|
this.modelFilter.addEventListener('focus', function() {
|
||||||
|
let modelFilterStyle = window.getComputedStyle(mf)
|
||||||
|
rootModelList.style.minWidth = modelFilterStyle.width
|
||||||
|
})
|
||||||
|
|
||||||
this.selectEntry(this.activeModel)
|
this.selectEntry(this.activeModel)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user