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

Missing iconClass in widget config causes crash while loading on mobile #983

Open
1 of 5 tasks
duckblaster opened this issue Mar 31, 2021 · 1 comment
Open
1 of 5 tasks

Comments

@duckblaster
Copy link
Contributor

duckblaster commented Mar 31, 2021

How often can you reproduce it?

  • Always
  • Sometimes
  • Rarely
  • Unable
  • I didn’t try

Description:

If there is a widget configured without an iconClass when the mobile sidebar loads it throws an error about Cannot read property 'replace' of undefined at line 40 of _sidebarTab.js:

this.buttonNode = put(this.tabsButtonNode, 'li a[role=tab] i.' + this.iconClass.replace(/ /g, '.') + '<<');

Steps to reproduce:

Remove the iconClass from a widget config and load it on a mobile device. If using the mobile emulation in browser devtools you need to reload to trigger the mobile sidebar.

  1. Include a JS Bin (or equivalent) link if possible. You can use this as a starting point. Alternatively create a Gist
  2. Detail the exact steps taken to produce the problem
  3. Include a gif if possible; you can use LICEcap to make a gif: http://www.cockos.com/licecap/
  4. Check the browser console for errors (Use F12 to access the console)

Expected results:

Either a fallback icon or an error in the dev tools regardless of whether it is loaded on mobile or desktop, so it is more obvious, other widgets should continue to load.
image

Actual results:

Cryptic error about Cannot read property 'replace' of undefined, other widgets listed after the problematic entry fail to load.
image

Environment:

Software Version
CMV Version latest master
Browser latest chrome
Operating system windows, android, iphone
@tmcgee
Copy link
Member

tmcgee commented Mar 31, 2021

@duckblaster Thanks for reporting this. I have seen the issue as well and it has been fixed. I have a significantly enhanced mobile toolbar that I will be adding soon.

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

No branches or pull requests

2 participants