Pretius / Pretius-APEX-Enhanced-Lov-Item

Oracle APEX plugin
MIT License
24 stars 11 forks source link

after upgrading apex to 19.2 and also enhanced LOV plugin to 1.1.0 from 1.0.4 we see that drop down does not have fit size #48

Closed VenkatesuNallu closed 4 years ago

VenkatesuNallu commented 4 years ago

Hi, we see that with 1.0.4 version the drop down (as we type to search) used to fetch records and auto sizes itself to specific limit (size of the plugin box) and looked good. But with upgrade to 1.1.0, we are seeing that its not sizable and the UI is not looking good. Attaching screenshot of drop down with values.

VenkatesuNallu commented 4 years ago

image

bostrowski commented 4 years ago

@VenkatesuNallu Please let me know when you finish updating the issue so I can read it all :-) I can see you are updating it on the fly and don't want to comment on the unfinished issue.

VenkatesuNallu commented 4 years ago

am done. please go ahead to take a look. Sorry about that. I had pasted an unrelated screenshot. hence had to delete it

VenkatesuNallu commented 4 years ago

Hi @bostrowski , Can you please check this issue ?

bostrowski commented 4 years ago

@VenkatesuNallu sorry for long time to answer - had a busy week.

So, indeed it is the bug that I haven't spotted while developing v1.1.0. What you can do is apply the fast fix on enhancedLovItem.js file level. It is a really simple fix that will be included in v1.1.1.

  1. Download file enhancedLovItem.js (Application \ Shared Components \ Plug-in \ Pretius Enhanced LOV item)
  2. Select lines from 143 to 150
  3. Cut them
  4. Paste selected lines after line 180 (after cutting lines the line number have changed).

lines from 143 to 150:

    this.prompt = this._promptCreateNew();

    if ( this.element.closest('.t-DialogRegion').length > 0 ) {
      this.element.closest('.t-DialogRegion-body').append( this.prompt.container );
    }
    else {
      $('body').append( this.prompt.container );  
    }

line 179 and 180 is the line with

    this.element.after( this.mask.container );
    this.element.hide();

It is all about the order of executing code and after change your _create method should look like:

  _create: function(){

    (...)

    this.mask = this._maskCreateNew();
    this.popup = this._popupCreateObject();

    (...)

    this.element.after( this.mask.container );
    this.element.hide();

    this.prompt = this._promptCreateNew();

    if ( this.element.closest('.t-DialogRegion').length > 0 ) {
      this.element.closest('.t-DialogRegion-body').append( this.prompt.container );
    }
    else {
      $('body').append( this.prompt.container );  
    }

    (...)    
  },

Prompt has to be initialized only when mask container is embedded in DOM tree.

VenkatesuNallu commented 4 years ago

Perfect. This is fixed now. thanks!