ContextPad#getPad deprecation - recommended replacement

Hello,

Sorry if this is stated somewhere I’ve missed, I’m currently uplifting bpmn-js from v16.5 to latest.

I’ve just noticed the deprecation warning around getPad

My usage is very similar to the upstream ContextPadProvider implementation:

function getReplaceMenuPosition(element) {
var padRect = contextPad.getPad(element).html.getBoundingClientRect();
return { x: padRect.left, y: padRect.bottom + 5 }; }

This position is then passed to:
popupMenu.open( element, 'bpmn-replace', getReplaceMenuPosition(element), { search: true } );

**Is there currently a recommended replacement for ContextPad#getPad(), or is continuing to use getPad() the expected approach until a replacement is introduced?
**
Thanks!

No replacement today as far as I know. Safe to use as long as upstream uses it I believe.

Background is exactly what you’re reporting - we need it for proper placement of elements “next to it”.

Cool thanks very much for the reply! :grinning_face:

I’m running into the same deprecation while upgrading bpmn-js. Since is still used by the existing ContextPadProvider code, it would be helpful to know if there’s already a recommended replacement or if we should keep using it for now.