on master help sign in
Fix 'Style already has a parent' error by creating fresh style instances per textField
commite966f381e79d00e1831d1936e0002fc36566109b authoriko <mail@iko.soy> dateSat 18 Apr 2026, 13:44 (6 months ago) parentabee433
2 files changed+5−2
client/TextFields.fs+2−2 client/ViewAddContact.fs+3
client/TextFields.fs+2−2
@@ -10,7 +10,7 @@ module TextFields =
1010 open Avalonia.Layout
1111 open Avalonia.Styling
1212
13− let private whiteBg =
13+ let private whiteBg () =
1414 let bg = Avalonia.Media.Immutable.ImmutableSolidColorBrush(Colors.White)
1515 let setter = Setter(Avalonia.Controls.Border.BackgroundProperty, bg)
1616
@@ -33,7 +33,7 @@ module TextFields =
3333 (Grid() {
3434 TextBox(value, msg).fontFamily(Constants.fontFamily).verticalAlignment(VerticalAlignment.Stretch).verticalContentAlignment(VerticalAlignment.Center).background(SolidColorBrush(Colors.White))
3535 Rectangle().stroke(Colors.Black).strokeThickness (4.)
36− }).styles (whiteBg)
36+ }).styles (whiteBg ())
3737
3838 let multilineTextField value msg =
3939 Grid() {
client/ViewAddContact.fs+3
@@ -21,6 +21,9 @@ module ViewAddContact =
2121 let content =
2222 ScrollViewer(
2323 (VStack(16.) {
24+
25+
26+
2427 match model.Auth with
2528 | Identified(id, _) ->
2629 let ob = hexToOb id.PubKeyHex