-
-
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
Allow removing extension inheritance with this-only: option #3020
base: dev
Are you sure you want to change the base?
Allow removing extension inheritance with this-only: option #3020
Conversation
Not a change request at all, just throwing out alternative naming ideas for the prefix itself in case you think they sound good ; |
Yeah What i like about There are other more complex options that are even more accurate and descriptive like |
@Telroshan I just tried updating this change to use |
Sounds like a good name to me! |
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.
one small change thank you!
As I said before, I'm not a big fan of these prefixes. Introducing attributes such as <form action="/action" hx-ext="ext1,ext2" hx-ext-disinherit="ext1"> <!-- disable inheritance for ext1 -->
<a href="#" hx-delete="/delete"></a>
</form> <form action="/action" hx-ext="ext1,ext2">
<a href="#" hx-get="/get" hx-ext-ignore="ext1,ext2"></a> <!-- ignore ext1,ext2 only on this element -->
<a href="#" hx-delete="/delete"></a>
</form> |
Description
Allow hx-ext extension inheritance to be disabled on an element with a new
this-only:
prefix instead of having to useignore:
on all children.It works by setting isParentScan to track when scanning parent nodes recursively and then ignoring recursive calls that have ignore: prefix. Otherwise it strips the ignore: prefix.
Also improved readability/performance/minification by:
removing un-needed explicit undefined checks
moving replace => trim
moving slice => indexOf
Corresponding issue: #3016
Testing
Added test to confirm extension with this-only: prefix does not get inherited as expected.
Checklist
master
for website changes,dev
forsource changes)
approved via an issue
npm run test
) and verified that it succeeded