nbuytaert1 / apex-select2

Select lists in Oracle APEX as they should be
https://apex.oracle.com/pls/apex/f?p=64237:20
GNU General Public License v2.0
56 stars 18 forks source link

APEX 5.0 Modal Pages #49

Closed martindsouza closed 9 years ago

martindsouza commented 9 years ago

In APEX 5.0 if Select2 is added on a modal page where it exceeds the page, what should happen? Right now it gets cut off:

image

Some options:

nbuytaert1 commented 9 years ago

Option 2 won't be possible indeed. Option 1 is a possibility, but I don't think it will be easy to calculate the height of the dropdown. Why don't you set the height manually with some CSS?

.select2-drop .select2-results {
  max-height: 100px;
}

Sorry for the lazy approach...

martindsouza commented 9 years ago

@nbuytaert1 That makes sense, no need to apologize. Thanks for the quick turn around.

rimblas commented 9 years ago

In the Super LOV plugin, Dan McGhan implemented a "Climb the DOM Tree" option. This was exactly for using it in Modal Windows. The LOV would "climb" the DOM tree and attach itself to the top most page, effectively adding it on top of the Modal Window iframe. Now, with Select2, this technique may be a lot more complicated because the drop down is not just floating on top in the middle of the viewport, it has a specific position that it needs to be respected. I just thought I would plant the seed and see if it generated any clever ideas. ;-)

nbuytaert1 commented 9 years ago

Thanks for the input Jorge. That's probably a valid workaround. One problem is that the Select2 plugin uses 15 component attributes, which is the limit. So adding extra attributes is not an option.

martindsouza commented 9 years ago

If it's any help for others, here's the selector I used to restrict the height on modal/dialog pages only:

body.t-Dialog-page .select2-drop .select2-results{
  max-height: 100px;
}