ionic2-autocomplete icon indicating copy to clipboard operation
ionic2-autocomplete copied to clipboard

Autocomplete takes full width of grid instead of column

Open fortuneNext opened this issue 6 years ago • 5 comments

When ion-auto-complete is embedded in an ion-col, it ignores the bounds of it.

For example the following code: <ion-content padding> <ion-grid> <ion-row> <ion-col col-2> <ion-auto-complete> </ion-auto-complete> </ion-col> <ion-col> <button ion-button>BUTTON</button> </ion-col> </ion-row> </ion-grid> </ion-content>

leads to this output:

unbenannt

Greetings and thanks for your good work!

fortuneNext avatar Nov 29 '17 13:11 fortuneNext

I've had the same issues.. I fixed by using the following CSS. You do need to modify it for your own requirements.

ion-auto-complete ul {
  left: 0px;
  width: 99.9%;
}

sandervankasteel avatar Nov 30 '17 08:11 sandervankasteel

I have the same issue and @sandervankasteel your solution does not work for me. @fortuneNext did you solve your problem and how ?

McRosbeef avatar Feb 23 '18 16:02 McRosbeef

@McRosbeef I solved it just changing width: 90vw; by width: 100%; on the auto-complete.css file

ion-auto-complete {
  overflow    : hidden !important;
  display: block;
  width: 100%;
  display: inline-block;
  ion-searchbar {
    padding: 1px !important;
  }

Jhonsensf avatar Feb 27 '18 12:02 Jhonsensf

@McRosbeef Thank you for your solution, but is there any other solution without modifying auto-complete.css file directly? How can I override the value?

JeongJun-Lee avatar Jul 13 '18 08:07 JeongJun-Lee

you can add

ion-auto-complete ul{
	left:17px; right:17px;
	width:auto;
}

anywhere in your custom css files to override auto-complete.css Adjust the margin to your needs

vulkanosaure avatar Jul 26 '18 09:07 vulkanosaure