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

Drawer links not working in history mode #153

Closed
laurentpayot opened this issue Nov 2, 2016 · 18 comments
Closed

Drawer links not working in history mode #153

laurentpayot opened this issue Nov 2, 2016 · 18 comments
Milestone

Comments

@laurentpayot
Copy link
Contributor

Hello, v0.8 is great. But quasar-drawer-link are not working within the drawer when the router is in history mode. With quasar dev as well as with Firebase hosting (with SPA rewrites to /index.html). Also $router.push(...) are not working within the drawer. Direct router-link from a "view" are working.
You can see all this by cloning this example repo: https://github.com/laurentpayot/quasar-layout-spa
Am I doing something wrong?

@robbertvc
Copy link

I'm having the same issue in my browser app. When the drawer is expanded, the router-links are behaving as expected, but when the drawer is in responsive (collapsible) mode, it is impossible to change the component in the nested view. It seems like the link fires, but then immediately changes back when the sidebar goes back to collapsed mode.

@murbanowicz
Copy link
Contributor

I haven't looked into code, but it may be related to the way how you are
handling showing/hiding drawer.
I had similar issues with other stuff in the past.
Are you sure drawer stays in DOM all the time? It could be the reson if
drawer is removed from BOM and then links are getting crazy

2016-11-02 8:07 GMT+00:00 robbertvc notifications@github.com:

I'm having the same issue in my browser app. When the drawer is expanded,
the router-links are behaving as expected, but when the drawer is in
responsive (collapsible) mode, it is impossible to change the component in
the nested view. It seems like the link fires, but then immediately changes
back when the sidebar goes back to collapsed mode.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#153 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI80knGOTv8PPcA9vakImrGDHLgKuY6-ks5q6ETCgaJpZM4KmvRW
.

@rstoenescu
Copy link
Member

Will investigate if this is indeed an issue.

@rstoenescu
Copy link
Member

This would happen for history mode only, right?

@robbertvc
Copy link

Yes, only in history mode.

@laurentpayot
Copy link
Contributor Author

Yes everything is fine with the hash mode.
I tried some rewrites with the connect-history-api-fallback plugin in script.dev.js, without success.

@laurentpayot
Copy link
Contributor Author

@mariaczi the problem occurs with links to simple "views" (i.e. inside the router-view of the layout, like Hello in my example repo) where the layout thus the drawer never goes away. It also happens whith links to full-page components replacing the layout (Login in my example repo).

@laurentpayot
Copy link
Contributor Author

@robbertvc and @mariaczi you're right, it only happens when the drawer is not visible (small screen). Interesting...

@rstoenescu
Copy link
Member

Haven't investigated yet, but I bet that it's because drawer close event should be triggered before router-link (subcomponent of drawer-link) changes route. This happens in hash mode but router link Vue implementation breaks this when on history mode. It should have been implemented more consistently. Closing the drawer goes back one step in window history (we need this to be able to close drawer with back button). I'll see for a workaround. Thanks for your feedback all!

@rstoenescu
Copy link
Member

Just curious, when on history mode (only), do you get any errors in the browser console, like the one below?

dom.js?bcd1:25 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.

@laurentpayot
Copy link
Contributor Author

@rstoenescu nope. Tried with Chrome and Firefox but didn't get your error.

@rstoenescu
Copy link
Member

Ok, a fix is on the way. Testing it from all angles.

@rstoenescu
Copy link
Member

Updated the "v2" default starter kit template with some work on history mode as first part of fixing this. quasarframework/quasar-template-default@6d3980f

@murbanowicz
Copy link
Contributor

will you publish to npm ?

2016-11-03 17:05 GMT+00:00 Razvan Stoenescu notifications@github.com:

Updated the "v2" default starter kit template with some work on history
mode as first part of fixing this. quasarframework/quasar-template-default@6d3980f
quasarframework/quasar-template-default@6d3980f


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#153 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI80khcxR228XLPPxhcLmjnCZpIduwkmks5q6hRQgaJpZM4KmvRW
.

@rstoenescu
Copy link
Member

No need to publish to npm. Latest Quasar CLI (there's been an update to it a few days ago so update it globally) picks up the github repo, and I've just committed to the repo.

@rstoenescu rstoenescu added this to the v0.9 milestone Nov 5, 2016
@laurentpayot
Copy link
Contributor Author

I will test the new route prop of quasar-drawer-link as soon as Quasar Framework v0.9 is released…

@laurentpayot
Copy link
Contributor Author

q-drawer-link are working with v0.9.1 👍 (didn't test #230 )

@dimiandre
Copy link

dimiandre commented Dec 21, 2017

Hi, for me is still not working

"quasar-framework": "^0.13.10"

history mode is disabled (at least i think, i don't have mode: "history" in the router class)

When i click a link of the drawer it works, but as soon i close the sidebar it come back to the original page. This happen only on small screen devices

any ideas?

EDIT:
it seems to be not working only if i add "v-if" to the drawerk-link

Working:

 <q-drawer-link :class="privateClass" icon="assistant" :to="{path: '/link', exact: true}">
      MyLink
    </q-drawer-link>

Not working:
<q-drawer-link :class="privateClass" icon="assistant" :to="{path: '/link', exact: true}" v-if="myCondition"> MyLink </q-drawer-link>

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

No branches or pull requests

5 participants