Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Send: Fix UI glitches after going back from Transaction Preview #12798

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions WalletWasabi.Fluent/Behaviors/FocusNextWhenValidBehavior.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reactive.Disposables;

Check notice on line 1 in WalletWasabi.Fluent/Behaviors/FocusNextWhenValidBehavior.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (master)

✅ No longer an issue: Complex Conditional

OnAttached no longer has a complex conditional. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.

Check notice on line 1 in WalletWasabi.Fluent/Behaviors/FocusNextWhenValidBehavior.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (master)

ℹ New issue: Complex Conditional

OnAttachedToVisualTree has 1 complex conditionals with 3 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
using System.Reactive.Linq;
using Avalonia;
using Avalonia.Controls;
Expand All @@ -9,17 +9,17 @@

namespace WalletWasabi.Fluent.Behaviors;

public class FocusNextWhenValidBehavior : DisposingBehavior<TextBox>
public class FocusNextWhenValidBehavior : AttachedToVisualTreeBehavior<TextBox>
{
protected override void OnAttached(CompositeDisposable disposables)
protected override void OnAttachedToVisualTree(CompositeDisposable disposables)
{
if (AssociatedObject is null)
{
return;
}

var hasErrors = AssociatedObject.GetObservable(DataValidationErrors.HasErrorsProperty);
var text = AssociatedObject.GetObservable(TextBox.TextProperty);
var hasErrors = AssociatedObject.GetObservable(DataValidationErrors.HasErrorsProperty).Skip(1);
var text = AssociatedObject.GetObservable(TextBox.TextProperty).Skip(1);

hasErrors.ToSignal()
.Merge(text.ToSignal())
Expand Down
2 changes: 2 additions & 0 deletions WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
_presenter.Loaded += PresenterOnLoaded;
}

InvalidateWatermark();
}

private void PresenterOnLoaded(object? sender, RoutedEventArgs e)
Expand Down