Autocomplete closes when scrolling on a touch device
Steps to reproduce:
- Open https://material.angular.io/components/autocomplete/overview in any touch device
- Use the example on the page, tap to show autocomplete
- If it was a longer list or you're viewing on a small device you would want to scroll to see the rest of the list. Scroll with touch.
- On touchend the autocomplete closes
Expected Behavior
It is the intended behavior according to the code in autcomplete.es5.js L:601
return merge(fromEvent(this._document, 'click'), fromEvent(this._document, 'touchend'))`
.pipe(filter(function (event) {
/** @type {?} */
var clickTarget = (/** @type {?} */ (event.target));
/** @type {?} */
var formField = _this._formField ?
_this._formField._elementRef.nativeElement : null;
return _this._overlayAttached &&
clickTarget !== _this._element.nativeElement &&
(!formField || !formField.contains(clickTarget)) &&
(!!_this._overlayRef && !_this._overlayRef.overlayElement.contains(clickTarget));
}));
The menu closes on touchend but I think it's a bug because it's normal to expect users to scroll on a mobile device to see the rest of the list. I think the fromEvent(this._document, 'touchend') should be removed or the code changed to allow scrolling
Environment
- Angular: 7.2.13
- CDK/Material: 7.3.7
- Browser(s): All browsers on a touch device
- Operating System (e.g. Windows, macOS, Ubuntu): All operating systems that support touch
We are closing this issue, because we've determined, using a semi-automated process, that it is no longer relevant, has low engagement, or it does not have enough information to proceed. Feel free to comment if you think the issue should be reopened, or open a new issue with the latest version of our code instead.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.