verbb / navigation

A Craft CMS plugin to create navigation menus for your site.
Other
90 stars 23 forks source link

Adding new items on long menus after scrolling shows an error notification #346

Closed josdigital closed 1 year ago

josdigital commented 1 year ago

Describe the bug

On long menus that requires scrolling, after scrolling and adding a new item, the item is added but the interface doesn't get updated immediately and an error warning is shown.

After digging into the error I found that this is originated from craft's BaseElementIndex.js updateElements method (line 1335) that is called from navigation.js with the addNodes method.

The error is coming from this.$main.offset().top where this.$main.offset() is undefined.

Steps to reproduce

  1. Create a new menu
  2. Add multiple items. The menu should be so long that scrolling the page is required to see the last item
  3. Scroll down and check that the main craft header stay fixed
  4. add a new item and save
  5. a confirmation notification ("Node added.") alongside an error message ("A server error occurred.") will be displayed

image

Please check the issue on this gif:

2023-03-20_10-28-56

Craft CMS version

4.4.3

Plugin version

2.0.16

Multi-site?

No

Additional context

Tested this error in a new fresh Craft 4 installation with only Navigation plugin installed.

engram-design commented 1 year ago

Thanks for the investigation, should be fixed in 2.0.17