Jsoneditor: Error when clicking a navigationBar path link

Created on 24 Oct 2018  路  10Comments  路  Source: josdejong/jsoneditor

https://github.com/josdejong/jsoneditor/commit/181140f733baddd2e643e18cf6f1fe1d516acb27#diff-9fd481e566a0f24de9121c0320b1503bL219

  • Missing null check in above commit
  • An error occurs if there is no 'frame' param.

console log :
ContextMenu.js:209 Uncaught TypeError: Cannot read property 'getBoundingClientRect' of undefined
at ContextMenu.webpackJsonp../node_modules/jsoneditor/src/js/ContextMenu.js.ContextMenu.show (ContextMenu.js:209)
at HTMLSpanElement.sepEl.onclick (TreePath.js:62)

bug

All 10 comments

Thanks for reporting @wander84, that's a bug.

@meirotstein do you have an idea where this can originate from? It did work in the past.

@josdejong I will have a look

it is still working...
@wanderg84 can u please provide steps for reproduce?
thanks!

@meirotstein it happens when you click the triangle between two names:

image

This should open a dropdown with all properties in the object, but it gives this error in the console:

Uncaught TypeError: Cannot read property 'getBoundingClientRect' of undefined
    at ContextMenu.show (jsoneditor.js:32922)
    at HTMLSpanElement.sepEl.onclick (jsoneditor.js:35442)

Ah, I think I caused this error after refactoring the ContextMenu some time ago. ContextMenu.show now requires a second argument in TreePath.js on line 62: menu.show(sepEl);. I will look into it soon (until you beat me Meir ;) )

@josdejong cool! nice fix!

yeah, well, I should have tested better when changing the ContextMenu. It was changed from being relatively positioned to being absolutely positioned.

Should be fixed now in v5.25.0

Thank you for your quick fix!

Was this page helpful?
0 / 5 - 0 ratings