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

Apply patches for movabletype repo to v1.5.4. MTC-29818 #2

Draft
wants to merge 14 commits into
base: v1.5.4-x
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix bug that value is reverted after moving cell in tables field on Edge
masiuchi committed Sep 9, 2024
commit 2571fe5ccad7d6ee8b7de5f185536a811fe2d86f
12 changes: 9 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -545,9 +545,13 @@ export default class aTable extends aTemplate {
range.setEndBefore(elem.lastChild.lastChild);
} else if (aTable.getBrowser() === 'edge'
&& elem.hasChildNodes() && elem.lastChild.tagName === 'DIV'
&& elem.lastChild.hasChildNodes() && elem.lastChild.lastChild.tagName === 'BR')
&& elem.lastChild.hasChildNodes())
{
range.setEndBefore(elem.lastChild.lastChild);
if (elem.lastChild.lastChild.tagName === 'BR') {
range.setEndBefore(elem.lastChild.lastChild);
} else {
range.setEndAfter(elem.lastChild.lastChild);
}
} else {
range.selectNodeContents(elem);
}
@@ -843,7 +847,9 @@ export default class aTable extends aTemplate {
if (this.afterEntered) {
this.afterEntered();
}
} else if (type === 'keyup' && aTable.getBrowser().indexOf('ie') !== -1) {
} else if (type === 'keyup'
&& (aTable.getBrowser().indexOf('ie') !== -1 || aTable.getBrowser() === 'edge'))
{
if (util.hasClass(this.e.target, 'a-table-editable') && this.e.target.parentNode.getAttribute('data-cell-id') === `${b}-${a}`) {
data.history.push(clone(data.row));
data.row[a].col[b].value = this.e.target.innerHTML.replace(/{(.*?)}/g, '{$1}');