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

add toggleElementEnabled member to DomUtility #36

Open
BryanWilhite opened this issue Aug 13, 2023 · 1 comment
Open

add toggleElementEnabled member to DomUtility #36

BryanWilhite opened this issue Aug 13, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@BryanWilhite
Copy link
Owner

    static toggleElementEnabled(element: HTMLElement | null): void {
        if (!element) { return; }

        element.toggleAttribute('disabled');
    }

https://github.com/BryanWilhite/Songhay.Player.ProgressiveAudio/blob/9ae33420745c54611cf4aabb40f6d0119245e520/Songhay.StudioFloor.Client/src/progressive-audio-utility.ts#L107

@BryanWilhite BryanWilhite added the enhancement New feature or request label Aug 13, 2023
@BryanWilhite BryanWilhite self-assigned this Aug 13, 2023
@BryanWilhite
Copy link
Owner Author

from my Obsidian notes:

forgetting the basics on the DOM…

Calling element.toggleAttribute(disabled) also sets the element.disabled property:

image

There is no need to set the element.disabled property explicitly. Additionally, because not all elements have a disabled property, slapping on an attribute is more ‘flexible.’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant