1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Focus amount input when click anywhere in amount field container

This commit is contained in:
Dan 2017-11-10 15:17:02 -03:30 committed by Chi Kei Chan
parent 5a0126f17b
commit a33ced3994
2 changed files with 4 additions and 0 deletions

View File

@ -76,6 +76,7 @@ CurrencyInput.prototype.render = function () {
className,
placeholder,
readOnly,
inputRef,
} = this.props
const inputSizeMultiplier = readOnly ? 1 : 1.2
@ -89,5 +90,6 @@ CurrencyInput.prototype.render = function () {
size: valueToRender.length * inputSizeMultiplier,
readOnly,
onChange: e => this.handleChange(e.target.value),
ref: inputRef,
})
}

View File

@ -82,6 +82,7 @@ CurrencyDisplay.prototype.render = function () {
style: {
borderColor: inError ? 'red' : null,
},
onClick: () => this.currencyInput.focus(),
}, [
h('div.currency-display__primary-row', [
@ -96,6 +97,7 @@ CurrencyDisplay.prototype.render = function () {
onInputChange: newValue => {
handleChange(this.getAmount(newValue))
},
inputRef: input => { this.currencyInput = input; },
}),
h('span.currency-display__currency-symbol', primaryCurrency),