Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete Menu bug #91

Open
swashbuck opened this issue Jun 19, 2024 · 1 comment
Open

Complete Menu bug #91

swashbuck opened this issue Jun 19, 2024 · 1 comment
Labels

Comments

@swashbuck
Copy link
Contributor

swashbuck commented Jun 19, 2024

Subject of the issue

When using the "Complete menu" button, topics are duplicated on the menu. Clicking into a topic and returning to the menu removes the duplicates.

It's possible that this is a bug with Box Menu instead.

Your environment

  • Dev Tools v3.5.4
  • Box Menu v6.7.0 and also the latest v7.0.1 (JSX)

Steps to reproduce

  1. Enable Dev Tools
  2. Visit the menu
  3. Open Dev Tools and click "Complete menu"

Screenshots

@swashbuck swashbuck added the bug label Jun 19, 2024
@oliverfoster
Copy link
Member

oliverfoster commented Jun 19, 2024

I'm guessing:

devtools click handler for complete menu button
https://github.com/cgkineo/adapt-devtools/blob/ffd7369163c8e070060b78a08f23fa5c95144165/js/adapt-devtools.js#L44C32-L44C46

onCompleteMenu, trigger trickle:kill

if (Adapt.devtools.get('_trickleEnabled')) Adapt.trigger('trickle:kill');

listen to trickle:kill
https://github.com/adaptlearning/adapt-contrib-trickle/blob/ac3768a1a91b67cfdc9d01b0353e1c0a89e1f9bd/js/controller.js#L59

trickle.kill
https://github.com/adaptlearning/adapt-contrib-trickle/blob/ac3768a1a91b67cfdc9d01b0353e1c0a89e1f9bd/js/controller.js#L232

Adapt.parentView.addChildren
https://github.com/adaptlearning/adapt-contrib-trickle/blob/ac3768a1a91b67cfdc9d01b0353e1c0a89e1f9bd/js/controller.js#L118

BoxMenuView.addChildren
https://github.com/adaptlearning/adapt-contrib-boxMenu/blob/74ad71fe54893aaf9f3a62cfa6de870c1dea9847/js/BoxMenuView.js#L27

always adds children from nthChild = 0

whereas AdaptView.addChildren
https://github.com/adaptlearning/adapt-contrib-core/blob/d1d4aae7bf2b2114629435a3136af7d571cf8a32/js/views/adaptView.js#L150

always adds children from the last nthChild.

BoxMenu.addChildren should probably keep nthChild over calls and then return early if nthChild is larger than the available to render children or just larger than 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants