diff --git a/web/lib/MRBS/Form/Element.php b/web/lib/MRBS/Form/Element.php index d023532ac5..964cfe113e 100644 --- a/web/lib/MRBS/Form/Element.php +++ b/web/lib/MRBS/Form/Element.php @@ -190,8 +190,11 @@ public function addClass(string $class) : Element $classes = $this->getAttribute('class'); $classes = (isset($classes)) ? explode(' ', $classes) : array(); - $classes[] = $class; - $this->setAttribute('class', implode(' ', $classes)); + if (!in_array($class, $classes)) + { + $classes[] = $class; + $this->setAttribute('class', implode(' ', $classes)); + } return $this; }