Commit 9182a9aa authored by Bas Lijnse's avatar Bas Lijnse

Merge branch 'formComponents' into 'master'

Small improvements related to form components

See merge request !233
parents 7b209b00 4e2cafa6
Pipeline #20026 passed with stage
in 4 minutes and 41 seconds
......@@ -76,8 +76,8 @@ JSONDecode{|Username|} _ c = (Nothing,c)
gEditor{|Username|} = bijectEditorValue (\(Username u) -> u) (\s -> (Username s)) (selectByMode
textView
(withDynamicHintAttributes "username" (withEditModeAttr textField ))
(withDynamicHintAttributes "username" (withEditModeAttr textField )))
(withDynamicHintAttributes "username" (withEditModeAttr textField <<@ minlengthAttr 1))
(withDynamicHintAttributes "username" (withEditModeAttr textField <<@ minlengthAttr 1)))
derive gDefault Username
derive gEq Username
......@@ -104,8 +104,8 @@ gText{|Password|} _ _ = ["********"]
gEditor{|Password|} = bijectEditorValue (\(Password p) -> p) (\s -> (Password s))
(selectByMode (comapEditorValue (const "********") textView)
(withDynamicHintAttributes "password" (withEditModeAttr passwordField ))
(withDynamicHintAttributes "password" (withEditModeAttr passwordField )))
(withDynamicHintAttributes "password" (withEditModeAttr passwordField <<@ minlengthAttr 1))
(withDynamicHintAttributes "password" (withEditModeAttr passwordField <<@ minlengthAttr 1)))
derive gDefault Password
derive gEq Password
......
......@@ -13,7 +13,7 @@ itasks.TextField = {
if('enabled' in me.attributes && me.attributes['enabled'] === false) {
el.disabled = true;
} else {
el.addEventListener('keyup',function(e) {
el.addEventListener('input',function(e) {
const rawV = e.target.value;
var v = Just(rawV);
if('maxlength' in me.attributes){
......@@ -60,7 +60,7 @@ itasks.TextArea = {
if('enabled' in me.attributes && me.attributes['enabled'] === false) {
el.disabled = true;
} else {
el.addEventListener('keyup',function(e) {
el.addEventListener('input',function(e) {
const rawV = e.target.value;
var v = Just(rawV);
if('maxlength' in me.attributes){
......@@ -105,7 +105,7 @@ itasks.PasswordField = {
if('enabled' in me.attributes && me.attributes['enabled'] === false) {
el.disabled = true;
} else {
el.addEventListener('keyup',function(e) {
el.addEventListener('input',function(e) {
const rawV = e.target.value;
var v = Just(e.target.value);
if('maxlength' in me.attributes){
......@@ -152,7 +152,7 @@ itasks.NumberField = {
if('enabled' in me.attributes && me.attributes['enabled'] === false) {
el.disabled = true;
} else {
el.addEventListener('keyup',function(e) {
el.addEventListener('input',function(e) {
var value = e.target.value == "" ? NaN : Number(e.target.value);
const isFloat = value % 1 !== 0;
value = (isNaN(value) || (!me.allowDecimal && isFloat)) ? Nothing : Just(value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment