-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Treat target="_self" the same as being empty #818
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- rebuilding this fork because of a corrupted git repository. This branch is "working" but needs more testing to be certain. - major changes to the way that htmx handles extensions. this will need to be vetted more carefully before we proceed.
- multichannel test works well. - removing debug code from simple SSE example
- to remove some pesky typescript errors/warnings
- trigger tests working. - settle tests failing
- nothing works.
- moving api reference from a function argument into the init() constructor
- Only adding JSDoc comments for functions that are useful for troubleshooting / validating the extension work. More thorough comments to come later.
"api" reference moved from function calls into the new "init" constructor. - just checking in progress... no tests tested. I have no idea if this code works or not yet. (so assume it's still a dumpster fire)
- internal API has been moved to a constructor variable. - added reconnect with exponential backoff - initial tests of SSE features are working - added many JSDoc comments in the process. - added link to "sse triggers" test
Updating this (in-progress) extension to us the init constructor
- removing more SSE boilerplate from WS extension.
- additional Typescript definitions to help analyze/migrate existing WebSocket code. - no code changes (except additions to internal api)
- removing more SSE boilerplate in favor of real WebSocket code - starting to implement "ws-connect" attribute. - nothing works yet. Do Not Use.
- new methods added to internal API - sort HtmxInternalApi
- wire up new functions into internal API - remove duplicate functions
…ed CSPs to still work with the new script insertion method.
- these functions are (currently) needed by the WebSocket extension. This may be cleaned up in the future once we are more confident with this architecture.
rebuild navigation and stylesheet for test pages.
playing with code coloring
Demo code: ```html <form hx-post="/form?token=123" hx-target="#result"> <input name="name" value="John Smith" /> <select name="role"> <option selected value="admin">Admin</option> <option selected value="author">Author</option> <option selected value="guest">Guest</option> </select> <button type="submit">Submit</button> </form> <output id="result"></output> <template url="/form"> <div>${JSON.stringify(params)}</div> </template> ```
* load htmx and hyperscript after mock-request, so you can use `init` and `load` correctly * disable all disableable elements while the demo environment is loading * support a `delay` attribute on templates to specify a delay * merged @dz4k's excellent simplification to the eval code
UPDATE I tested on HTMX 1.7.0 and the issue still persists, anchors with the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HI, just run into this issue and propose not to ignore anchors with the target="_self" attribute.
If I'm writing templates I have control on what attributes I add. But if the code is generated by something else, for example, a text editor on a CMS, I don't have control on such attributes. target='_self' is a standard and just tell us to load the page on the same browser window. Therefore I don't think an anchor with such attribute should be ignored by HTMX.
With Htmx 1.6.1 now I have to write an additional little routine to scrap the content of target. So it seems a little clunky.
UPDATE
I tested on HTMX 1.7.0 and the issue still persists.