Skip to content

Commit

Permalink
Merge pull request #1393 from scireum/feature/mbo/SIRI-940
Browse files Browse the repository at this point in the history
Colorpicker: Stops displaying color code when no color is set
  • Loading branch information
scireum-mbo authored Mar 8, 2024
2 parents 75ca366 + ad7cc95 commit 8494acd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/resources/default/taglib/t/colorpicker.html.pasta
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
</i:if>

<div class="input-group">
<input id="@textId"
<input @if(isFilled(fieldName)) { name="@fieldName" }
id="@textId"
type="text"
value="@UserContext.get().getFieldValue(name, value)"
class="form-control input-block-level @fieldClass"
@if (isFilled(placeholder)) { placeholder="@placeholder" }
@if (isFilled(tabIndex)) { tabindex="@tabIndex" }/>
<input @if(isFilled(fieldName)) { name="@fieldName" }
id="@colorId"
<input id="@colorId"
type="color"
value="@UserContext.get().getFieldValue(name, value)"
class="form-control form-control-color"
Expand All @@ -58,7 +58,9 @@
});

_textInput.addEventListener('change', () => {
_textInput.value = sirius.convertColorToHex(_textInput.value);
if (_textInput.value.length > 0) {
_textInput.value = sirius.convertColorToHex(_textInput.value);
}
});

_colorInput.addEventListener('input', () => {
Expand Down

0 comments on commit 8494acd

Please sign in to comment.