Skip to content

MudNavGroup: Use ParameterState framework#8980

Merged
henon merged 1 commit intoMudBlazor:devfrom
ScarletKuro:navgroup_param
May 15, 2024
Merged

MudNavGroup: Use ParameterState framework#8980
henon merged 1 commit intoMudBlazor:devfrom
ScarletKuro:navgroup_param

Conversation

@ScarletKuro
Copy link
Member

Description

Get rid of BL0007

How Has This Been Tested?

Visually, existing tests pass

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Unexpected behavior or functionality not working as intended PR: needs review labels May 15, 2024
@codecov
Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.48%. Comparing base (28bc599) to head (573f3d1).
Report is 204 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8980      +/-   ##
==========================================
+ Coverage   89.82%   90.48%   +0.65%     
==========================================
  Files         412      396      -16     
  Lines       11878    12127     +249     
  Branches     2364     2364              
==========================================
+ Hits        10670    10973     +303     
+ Misses        681      621      -60     
- Partials      527      533       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro ScarletKuro requested a review from henon May 15, 2024 22:30
Comment on lines 138 to 144
private void UpdateNavigationContext()
=> _navigationContext = _navigationContext with
{
Disabled = Disabled || _parentNavigationContextState.Value is { Disabled: true },
Expanded = _expanded
Disabled = _disabledState.Value || _parentNavigationContextState.Value is { Disabled: true },
Expanded = _expandedState.Value
&& _parentNavigationContextState.Value is null or { Expanded: true }
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is horrible. Not your changes, it was already a coding horror. I really don't understand what it does.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added in this PR: #8684

I introduced a NavigationContext that allows passing state down a navigation group chain which allows us to figure out whether buttons/links at a specific level of the chain should be focusable via keyboard navigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants