Tag Picker wipes out input text when Left arrow key is pressed
Environment Information
- Package version(s): 8.41.2
- Browser and OS versions: Edge 95.0.1020.44 on Windows 11
Please provide a reproduction of the bug in a codepen:
https://codepen.io/chuanqisun/pen/MWvGqzg
The bug repro was exported directly from the official component demo page, as of Nov. 8 2021, without any modification https://developer.microsoft.com/en-us/fluentui#/controls/web/pickers
Actual behavior:
After typing in pinkk, I press Left, and entire input is emptied.

Expected behavior:
After typing in pinkk, press Left should move the cursor to the position between the first k and the second k
Priorities and help requested:
Are you willing to submit a PR to fix? (depending on initial investigation)
Requested priority: (High)
Products/sites affected: (hits.microsoft.com)
@khmakoto, could you help us triage this bug?
@chuanqisun -Thanks for filing this issue with us. To set expectations, the developers will review this issue once capacity allows.
@layershifter - Would you be able to confirm if this is a regression, or if this behavior is an issue?
This is clearly a regression in v8, I created CodeSandbox with earliest stable version (@fluentui/[email protected]): https://codesandbox.io/s/stoic-matsumoto-1v1px?file=/src/App.tsx. I can repro it there, but on v7 it works fine.
Looking into it to get more details.
The problem happens in this handler:

That matches following in source code:
https://github.com/microsoft/fluentui/blob/c88ab7e4b2ba6ebadce68d569c6922cb1b0cd5f6/packages/react/src/components/Autofill/Autofill.tsx#L240-L245
I traced it and the change happened in #15227, before it was the same as in v7 🤔

The change that happened in #15227 does not seem correct to me, but I don't have enough context to propose the fix. @gouttierre would you mind to assign it to someone who works on v8 to fix it?
Following up on this issue, is there an update on when there will be a fix released?
Upon adding a debugger in the Basepicker, I see that there is no switch case for keyCodes for left or right arrow key
_this.onKeyDown = function (ev) {
// eslint-disable-next-line deprecation/deprecation
var keyCode = ev.which;
switch (keyCode) {
case KeyCodes.escape:
if (_this.state.suggestionsVisible) {
_this.setState({ suggestionsVisible: false });
ev.preventDefault();
ev.stopPropagation();
}
break;
case KeyCodes.tab:
case KeyCodes.enter:
Because this issue has not had activity for over 180 days, we're automatically closing it for house-keeping purposes.
Still require assistance? Please, create a new issue with up-to date details.