Fix numeric inputs not allowing negative numbers

Fix clipping on app updated icon
This commit is contained in:
JannisX11 2024-05-10 23:02:46 +02:00
parent bae176fa72
commit 50a1936c2c
4 changed files with 5 additions and 5 deletions

View File

@ -621,8 +621,8 @@
#mode_selector li.selected {
border-bottom: 3px solid var(--color-accent);
}
#update_menu {
padding-top: 2px;
#update_menu .tool > .icon {
margin-top: 3px;
}
/* Tab Bar */

View File

@ -670,7 +670,7 @@ class NumSlider extends Widget {
var scope = this;
this.node = Interface.createElement('div', {class: 'tool wide widget nslide_tool', toolbar_item: this.id}, [
Interface.createElement('div', {class: 'nslide tab_target', inputmode: 'decimal', 'n-action': this.id})
Interface.createElement('div', {class: 'nslide tab_target', inputmode: this.settings?.min >= 0 ? 'decimal' : '', 'n-action': this.id})
])
this.jq_outer = $(this.node)
this.jq_inner = this.jq_outer.find('.nslide');

View File

@ -789,7 +789,7 @@ Interface.CustomElements.SelectInput = function(id, data) {
this.set = setKey;
}
Interface.CustomElements.NumericInput = function(id, data) {
let input = Interface.createElement('input', {id, class: 'dark_bordered focusable_input', value: data.value || 0, inputmode: 'decimal'});
let input = Interface.createElement('input', {id, class: 'dark_bordered focusable_input', value: data.value || 0, inputmode: data.min >= 0 ? 'decimal' : ''});
let slider = Interface.createElement('div', {class: 'tool numeric_input_slider'}, Blockbench.getIconNode('code'));
this.node = Interface.createElement('div', {class: 'numeric_input'}, [
input, slider

View File

@ -131,7 +131,7 @@ Vue.component('numeric-input', {
},
template: `
<div class="numeric_input">
<input class="dark_bordered focusable_input" :value="string_value" @input="change($event.target.value)" inputmode="decimal" lang="en" @focusout="resolve($event)" @dblclick="resolve($event)">
<input class="dark_bordered focusable_input" :value="string_value" @input="change($event.target.value)" :inputmode="min >= 0 ? 'decimal' : ''" lang="en" @focusout="resolve($event)" @dblclick="resolve($event)">
<div class="tool numeric_input_slider" @mousedown="slide($event)" @touchstart="slide($event)"><i class="material-icons">code</i></div>
</div>
`,