question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignore fragments option / fragments included in query object

See original GitHub issue

It would be great if there was an option to ignore fragments/prevent fragments from triggering a route change. We aren’t using a hashbang scheme for our app, but we have links that are required to go to different anchors on the page.

For example, if I am on the main page of our app (/app/home) and click on an anchor that is supposed to scroll the user further down the page (/app/home#search), the route changes, which we don’t actually want.

Fragments are also included in the query object, which they shouldn’t be.

/app/search?q=Blah&type=documents#search

Query object:

{
    'q': 'Blah',
    'type': 'documents#search'
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
cognitomcommented, Jun 14, 2017

@struct78 the route.query() was designed to handle a url like this:

/app/search#search?q=Blah&type=documents

not like this:

/app/search?q=Blah&type=documents#search

But it should be able to handle the latter one, I think. We can simply change the RegExp on this line: https://github.com/riot/route/blob/f1bd42223963f9170cfd60045ca5824cb0f0f17f/src/index.js#L305

0reactions
GianlucaGuarinicommented, Nov 23, 2019

Closing this issue because it’s related to an old router version. Please update to the latest @riotjs/route version if you can.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fragments - Apollo GraphQL Docs
A GraphQL fragment is a piece of logic that can be shared between multiple queries and mutations. ... Every fragment includes a subset...
Read more >
How to exclude empty types when using fragments? #5567
Looking at this query, it's clear that the type can only be homepage_homepage_Entry . But the code generator generates this one: export type ......
Read more >
Content Fragment Models (Assets - Experience League - Adobe
Learn how Content Fragment Models serve as a foundation for your headless content in AEM and how to create Content Fragments with structured ......
Read more >
Fragment | Android Developers
All subclasses of Fragment must include a public no-argument constructor. ... This hook is called whenever an item in your options menu is...
Read more >
GraphQL Tutorial: how to use fields, fragments, and more
Sometimes we'll want to include the option for dynamic arguments in our queries, such as when making a search bar. GraphQL allows dynamic ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found