autocomplete popup sitting behind normal skuid popup

  • 1
  • Problem
  • Updated 4 years ago
  • Acknowledged
We are getting weird behaviour with autocomplete popup sitting behind skuid popup (normal dialog popup). We tried setting z-index property for autocomplete popup and it works first time and if you search again problem reappears. While inspecting element for z-index property of skuid popup and autocomplete popup we found that z-index property of skuid popup is increasing dynamically so as to make it more than z-index of autocomplete popup (i.e. if I set z-index of autocomplete popup to 105, skuid popup's z-index will be automatically set to 106). 
The problem occurs rarely on normal reference field. However, it happens almost all the times when we use custom field renderer (which is polymorphic in nature i.e. it can search different records such as account, Contact, Service__c etc). 
Any clues?
Photo of Gyan

Gyan

  • 1,400 Points 1k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
It's the jQueryUI dialog that is always fighting for the highest z-index.  It basically looks for the z-index of all of the dom elements that match the $('.ui-front') selector and makes its z-index one higher.  In our reference renderer we just escalate this with the following code.  You could probably do something similar.


input.focus(function(){
// Fix a bug where the autocomplete could show up behind dialogs.
input.autocomplete('widget').css('z-index',parseInt(input.closest('.ui-front').css('z-index'),10)+1);
});



(Edited)
Photo of Gyan

Gyan

  • 1,400 Points 1k badge 2x thumb
Thanks Ben, It worked!