mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 15:10:43 +02:00
Fix createElementFromAttrs bug (#31751)
The "false" value was not handled correctly, it would cause bugs in the future (fortunately, this behavior is not used in code yet).
This commit is contained in:
1 parent
d1283524b1
commit
e3678356e1
2 files changed
+4
-2
No files matched your search
@@ -297,7 +297,7 @@ export function createElementFromAttrs(tagName, attrs) {
|
||||
const el = document.createElement(tagName);
|
||||
for (const [key, value] of Object.entries(attrs)) {
|
||||
if (value === undefined || value === null) continue;
|
||||
if (value === true) {
|
||||
if (typeof value === 'boolean') {
|
||||
el.toggleAttribute(key, value);
|
||||
} else {
|
||||
el.setAttribute(key, String(value));
|
||||
|
||||
Reference in new issue
Block a user