From f5bdbe3466be4d8159680070b79aabf3f6cfc7bd Mon Sep 17 00:00:00 2001 From: Wei-Lun Li Date: Sun, 15 Nov 2026 17:17:52 +0900 Subject: [PATCH] fix(ui): show ALPN values that are not in the preset list (#10604) The ALPN combo box only lists a few fixed combinations. A node imported with another value, for example "h2,http/1.1,h3", keeps it, but the edit dialog shows an empty field and there is no way to enter such a value by hand. Make the combo box editable like the fingerprint one, so any stored value is shown and can be changed. The Desktop window had the same problem for the fingerprint combo boxes (for example "randomizednoalpn"); make them editable and bind their text, as the WPF window already does. --- v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml | 9 ++++++--- v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs | 6 +++--- v2rayN/v2rayN/Views/AddServerWindow.xaml | 1 + 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml index aad4e3b5..eba0aba7 100644 --- a/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml @@ -1415,7 +1415,8 @@ Grid.Row="2" Grid.Column="1" Width="200" - Margin="{StaticResource Margin4}" /> + Margin="{StaticResource Margin4}" + IsEditable="True" /> + Margin="{StaticResource Margin4}" + IsEditable="True" /> + Margin="{StaticResource Margin4}" + IsEditable="True" /> this.Bind(ViewModel, vm => vm.SelectedSource.StreamSecurity, v => v.cmbStreamSecurity.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AllowInsecure, v => v.togAllowInsecure.IsChecked).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.SelectedSource.Fingerprint, v => v.cmbFingerprint.SelectedValue).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.SelectedSource.Alpn, v => v.cmbAlpn.SelectedValue).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Fingerprint, v => v.cmbFingerprint.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Alpn, v => v.cmbAlpn.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CertSha, v => v.txtCertSha256Pinning.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CertTip, v => v.labCertPinning.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.Cert, v => v.txtCert.Text).DisposeWith(disposables); @@ -205,7 +205,7 @@ public partial class AddServerWindow : WindowBase //reality this.Bind(ViewModel, vm => vm.SelectedSource.Sni, v => v.txtSNI2.Text).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.SelectedSource.Fingerprint, v => v.cmbFingerprint2.SelectedValue).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SelectedSource.Fingerprint, v => v.cmbFingerprint2.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.PublicKey, v => v.txtPublicKey.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.ShortId, v => v.txtShortId.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.SpiderX, v => v.txtSpiderX.Text).DisposeWith(disposables); diff --git a/v2rayN/v2rayN/Views/AddServerWindow.xaml b/v2rayN/v2rayN/Views/AddServerWindow.xaml index 846b6aa6..b468c0cf 100644 --- a/v2rayN/v2rayN/Views/AddServerWindow.xaml +++ b/v2rayN/v2rayN/Views/AddServerWindow.xaml @@ -1657,6 +1657,7 @@ Grid.Column="1" Width="200" Margin="{StaticResource Margin4}" + IsEditable="True" Style="{StaticResource DefComboBox}" />