Specifying the axis on a textField seems to cause issues with the specified multiTextAlignment for the placeholder value of a textField.
I have a TextField with multiTextAlignment that works fine without specifying an axis to grow. As seen here ->
TextField("Answer", text: $userAnswer)
.fontWeight(.heavy)
.multilineTextAlignment(.center)
.cornerRadius(15)
.textFieldStyle(.roundedBorder)
.overlay(
Divider()
.frame(maxWidth: 300, maxHeight:1)
.background(.black), alignment: .bottom)
.padding([.bottom,.top])
.padding([.leading,.trailing], 25)
.focused($answerFieldFocus)
But as soon as I specify an axis for the TextField like so ->
TextField("Answer", text: $userAnswer, axis: .vertical)
.fontWeight(.heavy)
.multilineTextAlignment(.center)
.cornerRadius(15)
.textFieldStyle(.roundedBorder)
.lineLimit(2...4)
.overlay(
Divider()
.frame(maxWidth: 300, maxHeight:1)
.background(.black), alignment: .bottom)
.padding([.bottom,.top])
.padding([.leading,.trailing], 25)
.focused($answerFieldFocus)
The multiTextAlignment no longer works on the placeholder text. It still seems to work on text typed into the textFiled but the placeholder text now looks odd as it seems to be in the topLeading position in the text field. Any advice/info is appreciated. Thanks :)