Improve validation of editor's priority fields

prevent-invalid-input only applies to pattern matching, so ignore it.
Instead, auto-validate and provide an error message, and widen the
inputs so the message can be displayed fully.
This commit is contained in:
Oliver Hamlet
2016-11-25 21:10:08 +00:00
parent b5a491b921
commit da42713a19
@@ -83,6 +83,10 @@ loot-editor-close
iron-pages > *:not(.iron-selected) {
display: none;
}
#priorityValue,
#globalPriorityValue {
width: 250px;
}
/* Misc Styling. */
paper-toolbar.medium-tall {
@@ -139,11 +143,11 @@ loot-editor-close
</div>
<div>
<div>Priority</div>
<paper-input id="priorityValue" type="number" max="127" min="-127" step="1" prevent-invalid-input no-label-float></paper-input>
<paper-input id="priorityValue" error-message="Must be an integer between +/- 127 inclusive" type="number" max="127" min="-127" step="1" auto-validate no-label-float></paper-input>
</div>
<div>
<div>Global Priority</div>
<paper-input id="globalPriorityValue" type="number" max="127" min="-127" step="1" prevent-invalid-input no-label-float></paper-input>
<paper-input id="globalPriorityValue" error-message="Must be an integer between +/- 127 inclusive" type="number" max="127" min="-127" step="1" auto-validate no-label-float></paper-input>
</div>
</div>
<div id="after">