plasmo
plasmo copied to clipboard
[BUG] CSUI duplicated with PlasmoGetInlineAnchorList
What happened?
Using PlasmoGetInlineAnchorList
with <h1>
as anchor in https://docs.plasmo.com/, there will be two CSUI shown:
![image](https://user-images.githubusercontent.com/127918282/233125433-7234a8b7-10c0-4b69-88de-c21592a5e78d.png)
And then, if I click some links in the navigation on the left, more and more CSUIs show up:
![image](https://user-images.githubusercontent.com/127918282/233125973-4498a615-90a1-468b-b968-8b404af6ee9f.png)
Not sure whether it is related to #292
Steps to reproduce:
- create a new plasmo project with contents/inline:
pnpm create plasmo --entry=contents/inline
- edit and change
contents/inline.tsx
to
import type { PlasmoCSConfig, PlasmoGetInlineAnchorList } from "plasmo"
export const config: PlasmoCSConfig = {
matches: ["https://docs.plasmo.com/*"]
}
export const getInlineAnchorList: PlasmoGetInlineAnchorList = () =>
document.querySelectorAll("h1")
// Use this to optimize unmount lookups
export const getShadowHostId = () => "plasmo-inline-example-unique-id"
const PlasmoInline = () => {
return <button>Custom button</button>
}
export default PlasmoInline
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
(OPTIONAL) Contact Details
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] I checked the current issues for duplicate problems.