mirror of
https://github.com/dotnetcore/BootstrapBlazor.git
synced 2025-12-20 02:16:40 +08:00
fix(Print): support textarea html element (#3867)
* fix: support textarea element print view * chore: bump version 8.7.3-beta02
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>8.7.3-beta01</Version>
|
||||
<Version>8.7.3-beta02</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
|
||||
|
||||
@@ -40,21 +40,25 @@ const print = el => {
|
||||
body.appendChild(dialog)
|
||||
|
||||
// assign value
|
||||
dialog.querySelectorAll("input").forEach(ele => {
|
||||
const id = ele.getAttribute('id')
|
||||
const vEl = document.getElementById(id)
|
||||
if (vEl) {
|
||||
if (ele.getAttribute('type') === 'checkbox') {
|
||||
const v1 = vEl.checked
|
||||
if (v1 === true) {
|
||||
ele.setAttribute('checked', 'checked')
|
||||
const elements = ["input", "textarea"];
|
||||
elements.forEach(tag => {
|
||||
console.log(tag);
|
||||
dialog.querySelectorAll(tag).forEach(ele => {
|
||||
const id = ele.getAttribute('id')
|
||||
const vEl = document.getElementById(id)
|
||||
if (vEl) {
|
||||
if (ele.getAttribute('type') === 'checkbox') {
|
||||
const v1 = vEl.checked
|
||||
if (v1 === true) {
|
||||
ele.setAttribute('checked', 'checked')
|
||||
}
|
||||
}
|
||||
else {
|
||||
ele.value = vEl.value
|
||||
}
|
||||
}
|
||||
else {
|
||||
ele.value = vEl.value
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
const handler = setTimeout(() => {
|
||||
clearTimeout(handler)
|
||||
|
||||
Reference in New Issue
Block a user