File tree Expand file tree Collapse file tree
src/components/BootstrapBlazor.Region/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ protected override void OnParametersSet()
119119
120120 private void ResetValue ( )
121121 {
122- if ( ! string . IsNullOrEmpty ( Value ) )
122+ if ( ! string . IsNullOrEmpty ( Value ) && Value != GetCurrentValue ( ) )
123123 {
124124 var segments = Value . Split ( '-' , StringSplitOptions . RemoveEmptyEntries ) ;
125125 if ( segments . Length > 0 && _provinceValue != segments [ 0 ] && GetProvinces ( ) . Contains ( segments [ 0 ] ) )
@@ -153,6 +153,28 @@ private void ResetValue()
153153 }
154154 }
155155
156+ private string ? GetCurrentValue ( )
157+ {
158+ string ? value = null ;
159+ if ( ! string . IsNullOrEmpty ( _provinceValue ) )
160+ {
161+ value = _provinceValue ;
162+ }
163+ if ( ! string . IsNullOrEmpty ( _cityValue ) )
164+ {
165+ value = $ "{ _provinceValue } -{ _cityValue } ";
166+ }
167+ if ( ! string . IsNullOrEmpty ( _countyValue . Name ) )
168+ {
169+ value = $ "{ _provinceValue } -{ _cityValue } -{ _countyValue . Name } ";
170+ }
171+ if ( ! string . IsNullOrEmpty ( _detailValue ) )
172+ {
173+ value = $ "{ _provinceValue } -{ _cityValue } -{ _countyValue . Name } -{ _detailValue } ";
174+ }
175+ return value ;
176+ }
177+
156178 private async Task OnClearValue ( )
157179 {
158180 _provinceValue = "" ;
You can’t perform that action at this time.
0 commit comments