File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,7 +110,12 @@ CustomDialog {
110110 text: addressAddModel .address
111111 font .pixelSize : 14
112112 focus: ! control .nameEditMode
113- validator: RegularExpressionValidator { regularExpression: / [0-9a-zA-Z ] {1,} / }
113+ validator: RegularExpressionValidator { regularExpression: / \s * [0-9a-zA-Z ] * \s * / }
114+ Keys .onPressed : function (event ) {
115+ if (event .key === Qt .Key_Space ) {
116+ event .accepted = true
117+ }
118+ }
114119 Binding {
115120 target: addressAddModel
116121 property: " address"
Original file line number Diff line number Diff line change @@ -140,7 +140,13 @@ ColumnLayout {
140140 backgroundColor: tokenError ? Style .validator_error : Style .content_main
141141 font .italic : tokenError
142142 text: viewModel .token
143- validator: RegularExpressionValidator { regularExpression: / [0-9a-zA-Z ] {1,} / }
143+ validator: RegularExpressionValidator { regularExpression: / \s * [0-9a-zA-Z ] * \s * / }
144+
145+ Keys .onPressed : function (event ) {
146+ if (event .key === Qt .Key_Space ) {
147+ event .accepted = true
148+ }
149+ }
144150
145151 // % "Paste recipient address here"
146152 placeholderText: qsTrId (" send-contact-address-placeholder" )
Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ QString MessengerAddressAdd::getPeerID() const
5050
5151void MessengerAddressAdd::setAddress (const QString& addr)
5252{
53- if (_address != addr)
53+ const auto trimmed = addr.trimmed ();
54+ if (_address != trimmed)
5455 {
55- _address = addr ;
56+ _address = trimmed ;
5657 emit addressChanged ();
5758
5859 auto p = beam::wallet::ParseParameters (_address.toStdString ());
Original file line number Diff line number Diff line change @@ -236,10 +236,11 @@ QString SendViewModel::getToken() const
236236
237237void SendViewModel::setToken (const QString& value)
238238{
239- if (_token != value)
239+ const auto trimmed = value.trimmed ();
240+ if (_token != trimmed)
240241 {
241242 _newTokenMsg.clear ();
242- _token = value ;
243+ _token = trimmed ;
243244 _choiceOffline = false ;
244245
245246 if (QMLGlobals::isSwapToken (value))
You can’t perform that action at this time.
0 commit comments