Commit 1ef1030 1 parent d8b0458 commit 1ef1030 Copy full SHA for 1ef1030
File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk.Razor" >
2
2
3
3
<PropertyGroup >
4
- <Version >8.9.3-beta01 </Version >
4
+ <Version >8.9.3-beta02 </Version >
5
5
</PropertyGroup >
6
6
7
7
<ItemGroup Condition =" '$(TargetFramework)' == 'net5.0'" >
Original file line number Diff line number Diff line change @@ -16,16 +16,17 @@ export function init(id) {
16
16
17
17
export function update ( id , invalidIds ) {
18
18
const el = document . getElementById ( id ) ;
19
- const items = [ ...el . children ] ;
19
+ const items = [ ...el . querySelectorAll ( ".is-invalid" ) ] ;
20
20
const invalidElements = invalidIds . map ( cId => {
21
21
const item = document . getElementById ( cId ) ;
22
- let parentEl = item . parentElement ;
23
- while ( parentEl !== el ) {
24
- parentEl = parentEl . parentElement ;
22
+ let order = items . indexOf ( item ) ;
23
+ if ( order === - 1 ) {
24
+ const invalidEl = item . querySelector ( ".is-invalid" ) ;
25
+ if ( invalidEl ) {
26
+ order = items . indexOf ( invalidEl ) ;
27
+ }
25
28
}
26
- return {
27
- item, order : items . indexOf ( item )
28
- } ;
29
+ return { item, order } ;
29
30
} ) ;
30
31
invalidElements . sort ( ( a , b ) => b . order - a . order ) ;
31
32
You can’t perform that action at this time.
0 commit comments