Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(popup): the console reports an error in skyline mode #3315

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/popup/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ export default class Popup extends SuperComponent {
};

methods = {
handleContentTouchMove(e) {
if (e.target.dataset.prevention) {
return false;
}
},

handleOverlayClick() {
const { closeOnOverlayClick } = this.properties;
if (closeOnOverlayClick) {
Expand Down
2 changes: 1 addition & 1 deletion src/popup/popup.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- 暂时移除:aria-role="dialog" aria-modal="{{ true }}",关联:https://github.com/Tencent/tdesign-miniprogram/issues/2142 -->
<view
data-prevention="{{preventScrollThrough || (overlayProps ? !!overlayProps.preventScrollThrough : false)}}"
bind:touchmove="{{popup.onContentTouchMove}}"
bind:touchmove="handleContentTouchMove"
class="{{classPrefix}}__content {{prefix}}-class-content"
>
<slot name="content" />
Expand Down
9 changes: 1 addition & 8 deletions src/popup/popup.wxs
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
function getPopupStyles(zIndex, distanceTop, placement) {
var zIndexStyle = zIndex ? 'z-index:' + zIndex + ';' : '';
if ((placement === 'top' || placement === 'left' || placement === 'right') && distanceTop) {
zIndexStyle = zIndexStyle + 'top:' + distanceTop + 'px;'
zIndexStyle = zIndexStyle + 'top:' + distanceTop + 'px;';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么还要补一个分号?

}
return zIndexStyle;
}

function onContentTouchMove (e) {
if (e.target.dataset.prevention) {
return false;
};
}

module.exports = {
getPopupStyles: getPopupStyles,
onContentTouchMove: onContentTouchMove
};
Loading