Commit 5f7d79bf by Owen Ryan Ang

Fixed some issue with email input mode

parent ed8491d3
...@@ -245,7 +245,8 @@ const inputString = (key, validation) => { ...@@ -245,7 +245,8 @@ const inputString = (key, validation) => {
try { try {
const { const {
mandatory, mandatory,
fieldLength fieldLength,
collection
} = validation } = validation
let input = document.createElement('input') let input = document.createElement('input')
...@@ -261,7 +262,7 @@ const inputString = (key, validation) => { ...@@ -261,7 +262,7 @@ const inputString = (key, validation) => {
input.setAttribute('id', `${key}`) input.setAttribute('id', `${key}`)
input.setAttribute('name', `${key}`) input.setAttribute('name', `${key}`)
input.setAttribute('cols', 30) input.setAttribute('cols', 30)
if (key == 'Email') input.setAttribute('inputMode', 'email') if (collection === 'email') input.setAttribute('inputMode', 'email')
else input.setAttribute('inputMode', 'text') else input.setAttribute('inputMode', 'text')
input.addEventListener('focusout', handleInput) input.addEventListener('focusout', handleInput)
} else if (fieldLength >= 61 && fieldLength <= 90) { } else if (fieldLength >= 61 && fieldLength <= 90) {
...@@ -270,7 +271,7 @@ const inputString = (key, validation) => { ...@@ -270,7 +271,7 @@ const inputString = (key, validation) => {
input.setAttribute('id', `${key}`) input.setAttribute('id', `${key}`)
input.setAttribute('name', `${key}`) input.setAttribute('name', `${key}`)
input.setAttribute('cols', 30) input.setAttribute('cols', 30)
if (key == 'Email') input.setAttribute('inputMode', 'email') if (collection === 'email') input.setAttribute('inputMode', 'email')
else input.setAttribute('inputMode', 'text') else input.setAttribute('inputMode', 'text')
input.addEventListener('focusout', handleInput) input.addEventListener('focusout', handleInput)
} else if (fieldLength >= 91 && fieldLength <= 120) { } else if (fieldLength >= 91 && fieldLength <= 120) {
...@@ -279,7 +280,7 @@ const inputString = (key, validation) => { ...@@ -279,7 +280,7 @@ const inputString = (key, validation) => {
input.setAttribute('id', `${key}`) input.setAttribute('id', `${key}`)
input.setAttribute('name', `${key}`) input.setAttribute('name', `${key}`)
input.setAttribute('cols', 30) input.setAttribute('cols', 30)
if (key == 'Email') input.setAttribute('inputMode', 'email') if (collection === 'email') input.setAttribute('inputMode', 'email')
else input.setAttribute('inputMode', 'text') else input.setAttribute('inputMode', 'text')
input.addEventListener('focusout', handleInput) input.addEventListener('focusout', handleInput)
} else if (fieldLength >= 120) { } else if (fieldLength >= 120) {
...@@ -288,7 +289,7 @@ const inputString = (key, validation) => { ...@@ -288,7 +289,7 @@ const inputString = (key, validation) => {
input.setAttribute('id', `${key}`) input.setAttribute('id', `${key}`)
input.setAttribute('name', `${key}`) input.setAttribute('name', `${key}`)
input.setAttribute('cols', 30) input.setAttribute('cols', 30)
if (key == 'Email') input.setAttribute('inputMode', 'email') if (collection === 'email') input.setAttribute('inputMode', 'email')
else input.setAttribute('inputMode', 'text') else input.setAttribute('inputMode', 'text')
input.addEventListener('focusout', handleInput) input.addEventListener('focusout', handleInput)
} }
......
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