[Feature request] Updating / removing query params from the url
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Start by tracing the documented go to url behavior, especially variable-based URLs, and compare it with the issue's window.history.pushState example. Define a supported way to update or remove query parameters without navigation, including the requested view removal, and verify that the behavior is documented and covered by examples or tests.
Written by the indexing model from the issue text.
Description
Hi there,
Again - I want to express my ❤️ for _hyperscript!
One thing I'm struggling with is removing a query parameter from the url. I tried lots of things but this is what I ended up with:
<button class="modal-close is-large"
_="on click remove #company-edit-modal
js
window.history.pushState({}, document.title, window.location.pathname);
end"
aria-label="close"></button>
My journey started as follows:
<button class="modal-close is-large"
_="on click log the location of window
then set newLocation to the location of window
then log newLocation.origin + newLocation.pathname
then set newLocationUrl to newLocation.origin + newLocation.pathname
then log newLocationUrl
then go to url #(newLocationUrl)
"
aria-label="close"></button>
I just want to update the url and not navigate so according to the docs it should be possible by prepending it with a hash. However, this does not appear to be working with variables.
But how cool 😎 would the following be:
<button class="modal-close is-large"
_="on click remove #company-edit-modal then remove query param 'view' from the url"
aria-label="close"></button>
I tried a lot of the combinations above but none worked so I assume this is not implemented.
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 171
- 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 bigskysoftware/_hyperscript
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#688 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#678 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bigskysoftware/_hyperscript#676 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
bigskysoftware/_hyperscript#695 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
bigskysoftware/_hyperscript#687 ·
All issues in bigskysoftware/_hyperscript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·