|
|
|
@ -697,15 +697,14 @@ fun TextArea(
|
|
|
|
|
this.copyFrom(textAreaAttrsBuilder) |
|
|
|
|
}, |
|
|
|
|
content = { |
|
|
|
|
DomSideEffect(keyForRestoringControlledState.value, textAreaRestoreControlledStateEffect) |
|
|
|
|
DisposableEffect(keyForRestoringControlledState.value) { |
|
|
|
|
restoreControlledTextAreaState(element = scopeElement) |
|
|
|
|
onDispose { } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private val textAreaRestoreControlledStateEffect: DomEffectScope.(HTMLTextAreaElement) -> Unit = { |
|
|
|
|
restoreControlledTextAreaState(element = it) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
|
fun Nav( |
|
|
|
|
attrs: AttrBuilderContext<HTMLElement>? = null, |
|
|
|
@ -933,12 +932,11 @@ fun Style(
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
) { |
|
|
|
|
DomSideEffect(cssRules) { style -> |
|
|
|
|
(style.sheet as? CSSStyleSheet)?.let { cssStylesheet -> |
|
|
|
|
setCSSRules(cssStylesheet, cssRules) |
|
|
|
|
onDispose { |
|
|
|
|
clearCSSRules(cssStylesheet) |
|
|
|
|
} |
|
|
|
|
DisposableEffect(cssRules) { |
|
|
|
|
val cssStylesheet = scopeElement.sheet as? CSSStyleSheet |
|
|
|
|
cssStylesheet?.setCSSRules(cssRules) |
|
|
|
|
onDispose { |
|
|
|
|
cssStylesheet?.clearCSSRules() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -959,6 +957,12 @@ inline fun Style(
|
|
|
|
|
Style(applyAttrs, builder.cssRules) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun CSSStyleSheet.clearCSSRules() { |
|
|
|
|
repeat(cssRules.length) { |
|
|
|
|
deleteRule(0) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Adds <input> element of [type]. |
|
|
|
|
* |
|
|
|
@ -1017,15 +1021,14 @@ fun <K> Input(
|
|
|
|
|
if (type == InputType.Radio) { |
|
|
|
|
DisposeRadioGroupEffect() |
|
|
|
|
} |
|
|
|
|
DomSideEffect(keyForRestoringControlledState.value, inputRestoreControlledStateEffect) |
|
|
|
|
DisposableEffect(keyForRestoringControlledState.value) { |
|
|
|
|
restoreControlledInputState(inputElement = scopeElement) |
|
|
|
|
onDispose { } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private val inputRestoreControlledStateEffect: DomEffectScope.(HTMLInputElement) -> Unit = { |
|
|
|
|
restoreControlledInputState(inputElement = it) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
|
fun <K> Input(type: InputType<K>) { |
|
|
|
|
Input(type) {} |
|
|
|
|