-
Notifications
You must be signed in to change notification settings - Fork 6.8k
md-autocomplete list doesn't stick on it's position when scrolling on iOS #5187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Possible duplicate of #4557 |
+1 |
This should be working in beta.7. Can you give it another shot? |
I'm using @angular/material: 2.0.0-beta.7 and it doesn't work yet. |
No more chance on https://material.angular.io/components/autocomplete/examples |
Hi @molcik, did beta 7 solve your issue? I'm facing the same one. |
Still having the issue with beta 8 |
#3745 should have fixed repositioning while scrolling. I however noticed myself that it did not reposition in my project. This is because my autocomplete is inside an element with scroll. If I add a scrollbar to the entire site it works. But I only want the scrollbar on the content element (ie, not stretching over the toolbar). |
Also have this issue. Tested in your docs and in our own project. |
See #5797 and see if that helps you. Not sure if it's the same issue or not. Can't try it as there's no plnkr. |
@grizzm0 thx for the info :) |
Here's my Plunker where i added some The scrolling also gets triggered when the virtual keyboard slides from below. |
@PhilipSultanescu thanks |
Any update on this issue? If you open the angular material2 website on the mobile safari, this issue still exists. I think it relates to #6341 |
Hi @xiongemi. |
Hi, FYI I solved that issue by using custom import {
MdAutocompleteModule,
MD_AUTOCOMPLETE_SCROLL_STRATEGY,
Overlay, Platform,
...
} from '@angular/material';
export function MD_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY(overlay: Overlay, platform: Platform) {
return () => platform.IOS ? overlay.scrollStrategies.block() : overlay.scrollStrategies.reposition();
}
@NgModule({
imports: [
MdAutocompleteModule,
...
],
providers: [
...
{
provide: MD_AUTOCOMPLETE_SCROLL_STRATEGY,
deps: [Overlay, Platform],
useFactory: MD_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY,
},
],
}) |
@aitboudad I get '"node_modules/@angular/material/material"' has no exported member 'MD_AUTOCOMPLETE_SCROLL_STRATEGY' when I try that. Any idea why? I'm on 2.0.0-beta.8 |
@kevinaud // package.json
"@angular/cdk": "angular/cdk-builds",
"@angular/material": "angular/material-builds", |
Oh okay, thanks for the help. I've got that all working and the behavior is as expected on my computer, it won't allow scrolling while the autocomplete is open, but its still messed up on my iphone for some reason... As soon as I focus on the autocomplete and the keyboard opens up it moves my view down so the autocomplete is no longer visible. |
@aitboudad Thank you for your solution! Autocomplete works "somehow" on iOS when scrolling (it still does not scroll with body, but does not show over the input), but when i start filtering options it returns to reposition strategy. Any advice? |
Closing as duplicate of #4557 |
@aitboudad Thank you very much. I've just pasted this in my root module (app.module.ts): In the imports:
Before @NgModule annotation:
And then the providers array of the module:
I would tell the autocomplete overlay is fixed under the input and is not floading all over the screen when I scroll (that was a real mess) but it seems to be still possible to hide the input field scrolling on the top. I mean that the overlay is not really fixed to the input. |
Obviously, this component doesn't work well on iOS (using Safari, Firefox and Chrome). |
Having the same issue here!! Hope this fix soon!! |
Faced with this issue, provided solution with custom MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY not worked for me due
Angular - 5.1.0 |
by the way it isn't fixed |
Is this fixed? the samples on the site are fixed, I still experience it. |
I have the same issue! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug
What is the expected behavior?
md-autocomplete list should stick on it's position when scrolling on iOS
What is the current behavior?
md-autocomplete list doesn't stick on it's position when scrolling on iOS
What are the steps to reproduce?
What is the use-case or motivation for changing an existing behavior?
Current behavior avoids using this component, because in specific circumstances list gets out of the view rectangle.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular - 4.1.3
OS - iOS 10.2.1
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: