Skip to content

Commit

Permalink
New: Add onReadyStateChange event
Browse files Browse the repository at this point in the history
  • Loading branch information
raquo committed Jan 16, 2025
1 parent 99c095e commit 72adc1d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ trait DocumentEventProps { this: GlobalEventProps =>
lazy val onFullScreenError: EventProp[dom.Event] = eventProp("fullscreenerror")


/**
* The readystatechange event is fired when the readyState attribute of a Document is changed.
* This event is not cancelable and does not bubble.
*
* [[https://developer.mozilla.org/en-US/docs/Web/API/Document/readystatechange_event readystatechange_event @ MDN]]
*/
lazy val onReadyStateChange: EventProp[dom.Event] = eventProp("readystatechange")


/**
* The selectionchange event is fired when the current Selection of a Document is changed.
* This event is not cancelable and does not bubble.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import com.raquo.domtypes.common.EventPropDef

/** Events that work only on dom.document */
object DocumentOnlyEventPropDefs {

val defs: List[EventPropDef] = List(

EventPropDef(
scalaName = "onDomContentLoaded",
domName = "DOMContentLoaded",
Expand Down Expand Up @@ -51,6 +51,20 @@ object DocumentOnlyEventPropDefs {
),
),

EventPropDef(
scalaName = "onReadyStateChange",
domName = "readystatechange",
scalaJsEventType = "dom.Event",
javascriptEventType = "Event",
commentLines = List(
"The readystatechange event is fired when the readyState attribute of a Document is changed.",
"This event is not cancelable and does not bubble."
),
docUrls = List(
"https://developer.mozilla.org/en-US/docs/Web/API/Document/readystatechange_event",
),
),

EventPropDef(
scalaName = "onSelectionChange",
domName = "selectionchange",
Expand Down Expand Up @@ -79,5 +93,5 @@ object DocumentOnlyEventPropDefs {
),

)

}

0 comments on commit 72adc1d

Please sign in to comment.