Unescape HTML input text

This commit is contained in:
josdejong 2020-04-27 13:44:43 +02:00
parent c03353845e
commit 4fdf90fb38
1 changed files with 6 additions and 4 deletions

View File

@ -3,9 +3,10 @@
import { faCaretDown, faCaretRight } from '@fortawesome/free-solid-svg-icons' import { faCaretDown, faCaretRight } from '@fortawesome/free-solid-svg-icons'
import { SEARCH_PROPERTY, SEARCH_VALUE } from './search' import { SEARCH_PROPERTY, SEARCH_VALUE } from './search'
import classnames from 'classnames' import classnames from 'classnames'
import { isUrl, valueType } from './utils/typeUtils' import { isUrl, stringConvert, valueType } from './utils/typeUtils'
import { escapeHTML } from './utils/stringUtils.js' import { escapeHTML } from './utils/stringUtils.js'
import { createUpdateProps } from './utils/updateProps.js' import { createUpdateProps } from './utils/updateProps.js'
import { unescapeHTML } from './utils/stringUtils'
export let key = undefined export let key = undefined
export let value export let value
@ -53,13 +54,14 @@
} }
function handleKeyInput (event) { function handleKeyInput (event) {
const newKey = event.target.innerText const newKey = unescapeHTML(event.target.innerText)
onChangeKey(newKey, key) onChangeKey(newKey, key)
} }
function handleValueInput (event) { function handleValueInput (event) {
const value = event.target.innerText const valueText = unescapeHTML(event.target.innerText)
onChangeValue(value, key) const newValue = stringConvert(valueText) // TODO: implement support for type "string"
onChangeValue(newValue, key)
} }
function handleChangeKey (newChildKey, oldChildKey) { function handleChangeKey (newChildKey, oldChildKey) {