Merge pull request #12443 from zfox23/commerce_SendMoneyUiFix1

Commerce: Wallet/Send Money UI fixes
This commit is contained in:
John Conklin II 2018-02-21 09:02:13 -08:00 committed by GitHub
commit 9e1ea191b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View file

@ -75,8 +75,6 @@ Item {
// TODO: Fix this unlikely bug
onVisibleChanged: {
if (visible) {
passphraseField.error = false;
passphraseField.focus = true;
sendSignalToParent({method: 'disableHmdPreview'});
} else {
sendSignalToParent({method: 'maybeEnableHmdPreview'});
@ -206,6 +204,14 @@ Item {
placeholderText: "passphrase";
activeFocusOnPress: true;
activeFocusOnTab: true;
onVisibleChanged: {
if (visible) {
error = false;
focus = true;
forceActiveFocus();
}
}
onFocusChanged: {
root.keyboardRaised = focus;

View file

@ -923,7 +923,7 @@ Item {
anchors.leftMargin: 20;
anchors.right: parent.right;
anchors.rightMargin: 20;
height: 140;
height: 95;
FontLoader { id: firaSansSemiBold; source: "../../../../../fonts/FiraSans-SemiBold.ttf"; }
TextArea {
@ -947,8 +947,14 @@ Item {
wrapMode: TextEdit.Wrap;
activeFocusOnPress: true;
activeFocusOnTab: true;
// Workaround for no max length on TextAreas
onTextChanged: {
// Don't allow tabs or newlines
if ((/[\n\r\t]/g).test(text)) {
var cursor = cursorPosition;
text = text.replace(/[\n\r\t]/g, '');
cursorPosition = cursor-1;
}
// Workaround for no max length on TextAreas
if (text.length > maximumLength) {
var cursor = cursorPosition;
text = previousText;