mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fix tap knockable room and custom keyboard did show scrolling (#3603)
* making knockable rooms tappable * added a way to customise the keyboard scrolling in case we want the focussed view/textview to display something outside its content * better documentation
This commit is contained in:
@@ -15,6 +15,7 @@ struct CreateRoomScreen: View {
|
||||
private enum Focus {
|
||||
case name
|
||||
case topic
|
||||
case alias
|
||||
}
|
||||
|
||||
private var aliasBinding: Binding<String> {
|
||||
@@ -52,6 +53,7 @@ struct CreateRoomScreen: View {
|
||||
.toolbar { toolbar }
|
||||
.readFrame($frame)
|
||||
.alert(item: $context.alertInfo)
|
||||
.shouldScrollOnKeyboardDidShow(focus == .alias, to: Focus.alias)
|
||||
}
|
||||
|
||||
private var roomSection: some View {
|
||||
@@ -197,6 +199,8 @@ struct CreateRoomScreen: View {
|
||||
TextField("", text: aliasBinding)
|
||||
.textInputAutocapitalization(.never)
|
||||
.autocorrectionDisabled()
|
||||
.textContentType(.URL)
|
||||
.focused($focus, equals: .alias)
|
||||
.tint(.compound.iconAccentTertiary)
|
||||
.font(.compound.bodyLG)
|
||||
.foregroundStyle(.compound.textPrimary)
|
||||
@@ -209,6 +213,7 @@ struct CreateRoomScreen: View {
|
||||
.environment(\.layoutDirection, .leftToRight)
|
||||
.errorBackground(!context.viewState.aliasErrors.isEmpty)
|
||||
})
|
||||
.id(Focus.alias)
|
||||
} header: {
|
||||
Text(L10n.screenCreateRoomRoomAddressSectionTitle)
|
||||
.compoundListSectionHeader()
|
||||
|
||||
Reference in New Issue
Block a user