Popover not working
See original GitHub issueIssue description
- components:
Popovers
- reactstrap version
#5.0.0-beta.2
- import method
es
- react version
#16.2.0
- bootstrap version
#4.0.0
What is happening?
Popovers causing React to flag an error. I can confirm that I react-transition-group (2.2.1) and react-popper (0.8.2) installed. An element with the id ‘popover_0’ definitely exists in the dom.
Error message in console
app.js:118204 Uncaught Error: The target 'popover_0' could not be identified in the dom, tip: check spelling
at getTarget (app.js:118204)
at PopperContent.render (app.js:121384)
at finishClassComponent (app.js:77097)
at updateClassComponent (app.js:77074)
at beginWork (app.js:77449)
at performUnitOfWork (app.js:79448)
at workLoop (app.js:79512)
at HTMLUnknownElement.callCallback (app.js:69766)
at HTMLUnknownElement.d (raven.js:416)
at HTMLUnknownElement.wrapped (app.js:66317)
at Object.invokeGuardedCallbackDev (app.js:69805)
at invokeGuardedCallback (app.js:69662)
at renderRoot (app.js:79590)
at performWorkOnRoot (app.js:80238)
at performWork (app.js:80191)
at requestWork (app.js:80102)
at scheduleWorkImpl (app.js:79956)
at scheduleWork (app.js:79913)
at Object.enqueueSetState (app.js:75436)
at Connect../node_modules/react/cjs/react.development.js.Component.setState (app.js:116819)
at Connect.onStateChange (app.js:86931)
at dispatch (app.js:124694)
at app.js:124207
at dispatch (app.js:124260)
at app.js:149954
at <anonymous>
Code
basket.bundles.map((bundle, i) =>
<span className="d-flex align-items-center">
<Button id={ `popover_${ i }` } onClick={ () => console.log('toggle popover') }>
Launch Popover
</Button>
<Popover placement="bottom" isOpen={ true } target={ `popover_${ i }` } toggle={ () => console.log('toggle popover') }>
<PopoverHeader>Popover Title</PopoverHeader>
<PopoverBody>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</PopoverBody>
</Popover>
</span>
)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Bootstrap popover is not working - Stack Overflow
One robust solution is Writing script tag of jquery, popper before bootstrap javascript. like this, <script src="https://code.jquery.com/jquery- ...
Read more >Popovers · Bootstrap v5.0
Triggering popovers on hidden elements will not work. Popovers for .disabled or disabled elements must be triggered on a wrapper element.
Read more >Data Popover from Bootstrap is not working with HTML in ...
I am trying to add a bootstrap popover with html enabled to a Layouts visual editor cell. The editor converts the ending "...
Read more >Bootstrap Popover Plugin - W3Schools
The Popover Plugin. The Popover plugin is similar to tooltips; it is a pop-up box that appears when the user clicks on an...
Read more >Popover not working on next page
p>I added popover attribute when hover on the table with simple pagination feature. Popover works on the first page only, it doesn't work...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Shouldn’t the component be able to work out for itself if the thing in the DOM isn’t there, then render?
IIRC it did originally, but others thought a nice error message would be better to track down why it wasn’t appearing (thus the “check spelling” b/c in that case, the wanted DOM element would never be there)