Skip to content

Commit 5d6ddc9

Browse files
authored
Merge pull request #124 from XiNiHa/fix/selection
fix: make selectionStart/End nullable
2 parents 16c881a + b82cded commit 5d6ddc9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Webapi/Dom/Webapi__Dom__HtmlInputElement.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ module Impl = (
8181
@set external setMin: (t_htmlInputElement, string) => unit = "min"
8282
@get external max: t_htmlInputElement => string = "max"
8383
@set external setMax: (t_htmlInputElement, string) => unit = "max"
84-
@get external selectionStart: t_htmlInputElement => int = "selectionStart"
85-
@set external setSelectionStart: (t_htmlInputElement, int) => unit = "selectionStart"
86-
@get external selectionEnd: t_htmlInputElement => int = "selectionEnd"
87-
@set external setSelectionEnd: (t_htmlInputElement, int) => unit = "selectionEnd"
84+
@get @return(nullable) external selectionStart: t_htmlInputElement => option<int> = "selectionStart"
85+
@set external setSelectionStart: (t_htmlInputElement, option<int>) => unit = "selectionStart"
86+
@get @return(nullable) external selectionEnd: t_htmlInputElement => option<int> = "selectionEnd"
87+
@set external setSelectionEnd: (t_htmlInputElement, option<int>) => unit = "selectionEnd"
8888
@get external selectionDirection: t_htmlInputElement => string = "selectionDirection"
8989
@set
9090
external setSelectionDirection: (t_htmlInputElement, string) => unit = "selectionDirection"

src/Webapi/Dom/Webapi__Dom__HtmlTextAreaElement.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ external form: t => option<Dom.htmlFormElement> = "form"
7979
type selectionDirection = [#forward | #backward | #none]
8080

8181
@send external select: t => unit = "select"
82-
@get external selectionStart: t => int = "selectionStart"
83-
@set external setSelectionStart: (t, int) => unit = "selectionStart"
84-
@get external selectionEnd: t => int = "selectionEnd"
85-
@set external setSelectionEnd: (t, int) => unit = "selectionEnd"
82+
@get @return(nullable) external selectionStart: t => option<int> = "selectionStart"
83+
@set external setSelectionStart: (t, option<int>) => unit = "selectionStart"
84+
@get @return(nullable) external selectionEnd: t => option<int> = "selectionEnd"
85+
@set external setSelectionEnd: (t, option<int>) => unit = "selectionEnd"
8686
@get
8787
external selectionDirection: t => selectionDirection = "selectionDirection"
8888
@set

0 commit comments

Comments
 (0)