Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #27028
Closed
Open
Issue created Aug 06, 2018 by Administrator@rootContributor

data-toggle failing when an ID is a number

Created by: TikiTDO

I have a scenario with a bunch of data-toggle="collapse" href="5" etc... With the change to using document.querySelectors the lookup for such IDs is failing. This causes the data-toggle directive to no longer work for code that was working previously.

In my case this line was failing.

Please refer to this example in Chrome 68+ to get an idea of the failure scenario. With my setup I get the following output:

JS error: #1
JQ found: #1

JS found: #two2
JQ found: #two2

JS error: #3three
JQ found: #3three

JS not found: #invalid
JQ not found: #invalid
  • Operating system and version: Arch Linux, OSX, RHEL, Windows 10
  • Browser and version: Chrome 68
  • Some possible fixes:
    1. Return to using jQuery for resolving selectors,
    2. Convert the first letter of the ID to a unicode escape string
    3. Use document.getElementById or document.getElementByClassName whenever possible
Assignee
Assign to
Time tracking