From cfd894e6fb94af8176b4687bc93c3faa91e5e351 Mon Sep 17 00:00:00 2001 From: Maurycy Zarzycki Date: Sat, 15 Oct 2022 13:26:21 +0200 Subject: [PATCH] allow select widget class to update if it uses a filter and is output changes (#6987) * allow select widget class to update if it uses a filter and the filter output changes * rewrite code to be more idiomatic + updates local property --- core/modules/widgets/select.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/modules/widgets/select.js b/core/modules/widgets/select.js index b3177d967..8272a2783 100644 --- a/core/modules/widgets/select.js +++ b/core/modules/widgets/select.js @@ -175,6 +175,11 @@ SelectWidget.prototype.refresh = function(changedTiddlers) { return true; // If the target tiddler value has changed, just update setting and refresh the children } else { + if(changedAttributes.class) { + this.selectClass = this.getAttribute("class"); + this.getSelectDomNode().setAttribute("class",this.selectClass); + } + var childrenRefreshed = this.refreshChildren(changedTiddlers); if(changedTiddlers[this.selectTitle] || childrenRefreshed) { this.setSelectValue();