Link to MetaMask API Method expands but doesn't scroll to
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- frontend
Research direction
Open the API Playground link for eth_chainId and inspect the API documentation entry and its anchor-link handling. Trace how the URL hash expands a method, then verify that navigation also scrolls the expanded section into view. Done means links such as #eth_chainId both expand the method and bring it visibly into the viewport.
Written by the indexing model from the issue text.
Description
When navigating to the MetaMask API Playground using an anchor link of one of the API methods does expand the section, but does not scroll to that section. Therefore when trying to link from (for instance) documentation or blog articles, if the method is beyond the fold (bottom of the screen) the user may feel that they have not navigated correctly and will have to scroll on their own.
A good example of this is a method we like to link to a lot from various places:
eth_chainId
The purpose of this issue is to add the functionality needed, which could be something like:
if (window.location.hash) {
// Extract the anchor point from the URL
const anchor = window.location.hash.substr(1);
// Scroll to the anchor point on the page
window.scrollTo({
top: document.getElementById(anchor).offsetTop,
behavior: 'smooth'
});
}
Something like that.
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MetaMask/api-playground
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
MetaMask/api-playground#90 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
MetaMask/api-playground#44 ·
All issues in MetaMask/api-playground
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·