When the cursor is not over any control and not in a row/column, chan… #10230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Porting fix from the Out-Of-Process designer
Proposed changes
When the cursor is not over any control and not in a row/column, change insertIndex to the last one.
Root cause of this bug
In the original code, when the cursor is not on any control and not in a row/column, only the IBar is erased without processing the InsertionIndex of the control, so the top control cannot move to the bottom.
Before
The top control cannot be moved to the bottom, it always backs to the original position.
![BeforeChange](https://private-user-images.githubusercontent.com/132890443/280609916-f280c608-3f4b-4a27-b2bb-af69dc087528.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA4NjA4NzMsIm5iZiI6MTcyMDg2MDU3MywicGF0aCI6Ii8xMzI4OTA0NDMvMjgwNjA5OTE2LWYyODBjNjA4LTNmNGItNGEyNy1iMmJiLWFmNjlkYzA4NzUyOC5naWY_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxM1QwODQ5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMjMzMmRiNzlmODA0MTU1ZDUzNjU2ZTEwYjFhNDA2NTQ4OGJiZGZmYmU2MGUxOTQ2ODg2ZDU2MzVhMDE1ZWZlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Tu2roeETCHEX4lA5-F7y-CFQ_62FCIBdcNx_8vQdqqY)
After
The top control can be moved to the bottom
![AfterChange](https://private-user-images.githubusercontent.com/132890443/280609410-32e8d9d0-bf61-4124-96ce-ce25ca94707d.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA4NjA4NzMsIm5iZiI6MTcyMDg2MDU3MywicGF0aCI6Ii8xMzI4OTA0NDMvMjgwNjA5NDEwLTMyZThkOWQwLWJmNjEtNDEyNC05NmNlLWNlMjVjYTk0NzA3ZC5naWY_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxM1QwODQ5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zZDkzNzliNmU5OTg1MTcyMDBlZjc3M2FjMWZhYmYwOTU2NWQwOGVhNDU0ZWJiMTJlZDU4NTFkNDllZGQ3M2Y2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.uuQOBqyujsFuSQipj7gibisDLmdMVbU_yXNRHuErh90)
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow