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

Provides a short access to document elements by ID via delegated #126

Merged
merged 1 commit into from Jan 19, 2024

Conversation

jonnyzzz
Copy link
Member

property syntax. Received element is not cached and received
directly from the [Document] by calling [Document.getElementById]
function on every property access. Throws an exception if element
is not found or has different type
To access an element with theId ID use the following property declaration

val theID by document.gettingElementById

To access an element of specific type, just add it to the property declaration

val theID : HTMLImageElement by document.gettingElementById

see for more details:
https://youtrack.jetbrains.com/issue/KT-32552

@jonnyzzz
Copy link
Member Author

Also reported in JetBrains/kotlin#2458

property syntax. Received element is not cached and received
directly from the [Document] by calling [Document.getElementById]
function on every property access. Throws an exception if element
is not found or has different type
To access an element with theId ID use the following property declaration

```
val theID by document.gettingElementById
```

To access an element of specific type, just add it to the property declaration

```
val theID : HTMLImageElement by document.gettingElementById
```

see for more details:
https://youtrack.jetbrains.com/issue/KT-32552
@e5l e5l self-requested a review January 19, 2024 10:30
@e5l e5l self-assigned this Jan 19, 2024
Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jonnyzzz, thanks for the PR and sorry for the delay

LGTM

@e5l e5l merged commit 56694cf into master Jan 19, 2024
1 check passed
@e5l e5l deleted the KT-32552 branch January 19, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants