Skip to content

Commit

Permalink
Update inputMethodHints flags in other inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasMizera committed May 27, 2024
1 parent 9c6d6eb commit c8bae3d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
6 changes: 4 additions & 2 deletions app/qml/account/MMLoginPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ MMPage {
width: parent.width

title: qsTr( "Email or username" )
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhEmailCharactersOnly
textField.inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhEmailCharactersOnly
}

MMPasswordInput {
Expand Down Expand Up @@ -204,7 +204,9 @@ MMPage {
textFieldBackground.color: __style.lightGreenColor

text: root.apiRoot
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhUrlCharactersOnly

// Qt.ImhNoPredictiveText must be accompanied by Qt.ImhSensitiveData, see https://bugreports.qt.io/browse/QTBUG-86982
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhUrlCharactersOnly
}

MMListSpacer { height: __style.spacing40 }
Expand Down
4 changes: 2 additions & 2 deletions app/qml/account/MMSignUpPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ MMPage {
width: parent.width

title: qsTr( "Username" )
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
textField.inputMethodHints: Qt.ImhNoAutoUppercase
}

MMTextInput {
Expand All @@ -81,7 +81,7 @@ MMPage {
width: parent.width

title: qsTr( "Email" )
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhEmailCharactersOnly
textField.inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhEmailCharactersOnly
}

MMPasswordInput {
Expand Down
8 changes: 7 additions & 1 deletion app/qml/form/editors/MMFormTextEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ MMPrivateComponents.MMBaseSingleLineInput {
text: _fieldValue === undefined || _fieldValueIsNull ? '' : _fieldValue

readOnly: _fieldIsReadOnly
textField.inputMethodHints: root._field.isNumeric ? Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly : Qt.ImhNoPredictiveText

title: _fieldShouldShowTitle ? _fieldTitle : ""

Expand Down Expand Up @@ -75,6 +74,13 @@ MMPrivateComponents.MMBaseSingleLineInput {
root.editorValueChanged( val, val === "" )
}

Component.onCompleted: {
// Use numerical keyboard for number fields configured as texts
if ( root._field.isNumeric ) {
textField.inputMethodHints |= Qt.ImhFormattedNumbersOnly
}
}

QtObject {
id: internal

Expand Down
2 changes: 0 additions & 2 deletions app/qml/form/editors/MMFormTextMultilineEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ MMPrivateComponents.MMBaseInput {
}
placeholderTextColor: __style.darkGreyColor

inputMethodHints: Qt.ImhNoPredictiveText

readOnly: root.editState !== "enabled"

background: Rectangle {
Expand Down
3 changes: 2 additions & 1 deletion app/qml/inputs/MMPasswordInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ MMPrivateComponents.MMBaseSingleLineInput {

textField.echoMode: eyeButton.pressed ? TextInput.Normal : TextInput.Password

textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhSensitiveData | Qt.ImhHiddenText
// Qt.ImhNoPredictiveText must be accompanied by Qt.ImhSensitiveData, see https://bugreports.qt.io/browse/QTBUG-86982
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhHiddenText

rightContent: MMComponents.MMIcon {
id: eyeButton
Expand Down
2 changes: 1 addition & 1 deletion app/qml/settings/components/MMSettingsInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ MMSettingsItem {
textFieldBackground.color: __style.lightGreenColor

text: root.value
textField.inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
textField.inputMethodHints: Qt.ImhNoAutoUppercase
}

MMComponents.MMListSpacer { height: __style.spacing40 }
Expand Down

1 comment on commit c8bae3d

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.5.624811 just submitted!

Please sign in to comment.