-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: tab active icon * fix: some isssue * fix: issuse about hover * fix: carousel component * refactor: remove useless code * fix: bind item click * Update text-field.html * fix: add placeholder * feat: drawer component support dialog-not-mobile * fix: more style issuse * fix: dialog style * fix: some issuse * Update dialog.html * chore: bump version --------- Co-authored-by: huang yao <[email protected]>
- Loading branch information
Showing
18 changed files
with
166 additions
and
91 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
export default function bindItemClick(_this, success) { | ||
export default function bindClick(_this, success) { | ||
_this.on("click", (e) => { | ||
if (_this.disabled === null) { | ||
const notSlotEls = _this.filter((e) => e.is(`:not([slot])`)); | ||
if ( | ||
notSlotEls.length === 1 && | ||
notSlotEls[0].tag === "a" && | ||
e.target.tagName !== "A" | ||
) { | ||
notSlotEls[0].ele.dispatchEvent(new PointerEvent("click")); | ||
if (_this.disabled !== null) { | ||
e.stopImmediatePropagation(); | ||
return; | ||
} | ||
|
||
const notSlotEls = _this.filter((e) => e.is(`:not([slot])`)); | ||
if (notSlotEls.length === 1 && notSlotEls[0].tag === "a") { | ||
if (e.target.tagName === "A") { | ||
return; | ||
} | ||
|
||
success && success(); | ||
} else { | ||
e.stopImmediatePropagation(); | ||
|
||
if (navigator.userAgent.includes("Firefox")) { | ||
notSlotEls[0].ele.click(); | ||
} else { | ||
notSlotEls[0].ele.dispatchEvent( | ||
new PointerEvent("click", { | ||
metaKey: e.metaKey, | ||
shiftKey: e.shiftKey, | ||
bubbles: e.bubbles, | ||
cancelable: true, | ||
}) | ||
); | ||
} | ||
} | ||
|
||
success && success(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.