Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a way to define a route-link as active based on query string #107

Open
blikblum opened this issue Dec 7, 2019 · 0 comments
Open

Comments

@blikblum
Copy link

blikblum commented Dec 7, 2019

Resources:
Before submitting an issue, please consult our docs.

Stencil version: (run npm list @stencil/core from a terminal/cmd prompt and paste output below):

@stencil/router: 1.0.1

I'm submitting a ... (check one with "x")
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:

Is not possible to toggle active state from a stencil-route-link based on the query string value.
urlMatch or url are always matched against pathname which does not include the query string

Expected behavior:

Implement an interface to set active state based on query string

react-router implements isActive callback for this feature

Steps to reproduce:

Try to toggle active state on query change without changing the path:

<stencil-route-link 
          url-match="/?tab=feed"
          url="/?tab=feed"
          >Your Feed
</stencil-route-link >

The above link will be marked active when url is "/?tab=feed" or "/?tab=all". There's no way to make only active only when url is "/?tab=feed".

Related code:

exact param does not change the behavior thus is different from #67

I'm trying to convert a React project to web component: https://github.com/gothinkster/react-mobx-realworld-example-app/blob/master/src/pages/Home/MainView.js#L13

Other information:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant