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

Geotab Drive dom conflict #28

Open
stechnique opened this issue Mar 17, 2021 · 0 comments
Open

Geotab Drive dom conflict #28

stechnique opened this issue Mar 17, 2021 · 0 comments

Comments

@stechnique
Copy link
Contributor

In the new generator-addin, instead of creating a root element with the add-in name, it creates a root element with an id of 'app'. It automatically adds code like elAddin = document.getElementById('app').
This works fine in MyGeotab, but when creating a Geotab Drive add-in, the Drive app already uses an 'app' id which is above our add-in in the DOM tree, and it produces this structure :

  <div id='app'>
    <div role='navigation' id='topbar-container'>...</div>
    <div role='main' id='main'>
      <div id='scroll-content'>
        <section id='content' class='addin-content'>
          <div id='app'>
              ... ADD-IN CONTENT HERE ...
          </div>
        </section>
      </div>
    </div>
    ...
  </div>

This is a problem in and of itself to have 2 identical IDs in the DOM, and gets worse because on blur the scaffolded code hides elAddin, which hides the entire Drive app UI instead of just our add-in content.
Is there a reason why the new generator uses id='app' instead of relying on the root add-in element like previous versions did? Is it supported for us to change this main element ID in our Drive add-ins, or are you relying on it being identified 'app'?

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

1 participant