@lion/form-core
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.2.6](https://github.com/ing-bank/lion/compare/@lion/form-core@0.2.5...@lion/form-core@0.2.6) (2020-07-16) | ||
### Bug Fixes | ||
* **form-core:** remove possible untrusted input value callback ([e06196d](https://github.com/ing-bank/lion/commit/e06196dec86f6d99fda0ed1c5dac3f62e3e34f6d)) | ||
## [0.2.5](https://github.com/ing-bank/lion/compare/@lion/form-core@0.2.4...@lion/form-core@0.2.5) (2020-07-13) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@lion/form-core", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "Form-core contains all essential building blocks for creating form fields and fieldsets", | ||
@@ -46,3 +46,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "b7ea11c767cd3c3998db65c64aa9e36794fee0c2" | ||
"gitHead": "48b145fc22a4a4206a40e657bd4f729c541d0270" | ||
} |
@@ -44,2 +44,5 @@ import { LitElement, SlotMixin } from '@lion/core'; | ||
}, | ||
value: { | ||
type: String, | ||
}, | ||
}; | ||
@@ -83,2 +86,5 @@ } | ||
this._setValueAndPreserveCaret(value); | ||
this.__value = undefined; | ||
} else { | ||
this.__value = value; | ||
} | ||
@@ -88,3 +94,3 @@ } | ||
get value() { | ||
return (this._inputNode && this._inputNode.value) || ''; | ||
return (this._inputNode && this._inputNode.value) || this.__value || ''; | ||
} | ||
@@ -104,9 +110,2 @@ | ||
connectedCallback() { | ||
// TODO: Investigate issue below. | ||
// Normally we put super calls on top for predictability, | ||
// here we temporarily need to do attribute delegation before, | ||
// so the FormatMixin uses the right value. Should be solved | ||
// when value delegation is part of the calculation loop of | ||
// FormatMixin | ||
this._delegateInitialValueAttr(); | ||
super.connectedCallback(); | ||
@@ -140,13 +139,2 @@ this._onChange = this._onChange.bind(this); | ||
/** | ||
* This is not done via 'get delegations', because this._inputNode.setAttribute('value') | ||
* does not trigger a value change | ||
*/ | ||
_delegateInitialValueAttr() { | ||
const valueAttr = this.getAttribute('value'); | ||
if (valueAttr !== null) { | ||
this.value = valueAttr; | ||
} | ||
} | ||
resetInteractionState() { | ||
@@ -153,0 +141,0 @@ if (super.resetInteractionState) { |
249714
5946