Repository navigation
Conversation
|
This will lead to duplicate buttons |
|
@yakov116 Well, I was testing it multiple times and it never gave me multiple buttons. Additionally, it seems that we already had this 'solution' in place for the |
|
|
||
| document.addEventListener('pjax:end', () => { | ||
| if (repeatOnBackButton || !select.exists('has-rgh')) { | ||
| if (repeatOnBackButton || !select.exists('has-rgh') || forceReinit) { |
There was a problem hiding this comment.
As this line suggests, this is equivalent to repeatOnBackButton: true, just under a different name.
This issue is a little complex. Basically we have 2 solutions:
- rework how the automatic deduplication mechanism work (hard)
- rename
repeatOnBackButton: truetoiAlreadyHandleDeduplicationThankYouVeryMuch: trueand handle deduplication via the usual:not(.rgh-etc)selector like we do for most features.
I think the latter is easier. This way we still keep has-rgh as a generic fallback but also have the opportunity to opt-out when it causes problems (like in this case)
There was a problem hiding this comment.
This is exactly what I was asking about. Figured out the root of the issue, but I wasn't exactly sure how we want to tackle it - I think that I'll work on this dedup mechanism, and create another PR for it then.
|
Closing this PR - will open another with a better solution. |
Navigating to files doesn't reload the whole page. This causes some of the features to not initialize - a similar situation to
Go backin the browser history.Solution:
Added additional flag to force re-init on
pjax:end, but it does the same thing asrepeatOnBackButton. According to pjax docs this is something that we should do.I added an additional flag for this one because the
repeatOnBackButtonname doesn't really fit in this case. I can merge those two with a better name if we agree that this solution is okay.cc @fregante
Closes #3945