-
-
Notifications
You must be signed in to change notification settings - Fork 52
feat(Tweaks): "Make the “Create” button start a new text post" #1983
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
Conversation
|
Do we want to make the button continue to target the current community when on a communities page? |
I had absolutely no idea that that was a thing. That's fun. |
|
We could make the selector |
marcustyphoon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected!
We actually want to re-process buttons (which this would prevent) when the addon restarts, since |
|
Oh, yeah, I guess that would prevent reprocessing! Can't have that. |
Description
Adds a new option to Tweaks that modifies the "Create" button on the desktop layout to navigate straight to
/new/textinstead of the/newinterstitial with the post type bubbles.To help achieve this elegantly, the reusable
onClickNavigatehandler has been modified to stop event propagation when a modifier key is detected, or we have entered the codepath that callsnavigate(). This hides the element from React's event processing, making the element behave more like one that we've created ourselves—forcing it to follow what the DOMhrefis, and not the React virtual DOM link target.We only use
onClickNavigatein one other place, Tag Tracking+, where this change has no effect at all. If we do ever need to build something where we do need click events on internal links to bubble... we can worry about that when we get there! (Probably just two variations of the same reusable handler; the only unknown there would be the naming.)Testing steps
Setup
Feature testing – Desktop layout
https://www.tumblr.com/new/texthttps://www.tumblr.com/new/textis opened in a new tabhttps://www.tumblr.com/new/textis opened in a new windowRegression testing – Mobile layout
https://www.tumblr.com/new