#103 textContent get issue
This commit is contained in:
@@ -722,7 +722,7 @@ export const getTextMethod = function () {
|
||||
const selectedElements = elemContext_.getSelectedElements();
|
||||
const selected = selectedElements[0];
|
||||
if (isNullish(selected)) { return ''; }
|
||||
return selected.textContent;
|
||||
return (selected) ? selected.textContent : '';
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -294,7 +294,7 @@ export class ChangeElementCommand extends Command {
|
||||
this.oldValues = attrs;
|
||||
for (const attr in attrs) {
|
||||
if (attr === '#text') {
|
||||
this.newValues[attr] = elem.textContent;
|
||||
this.newValues[attr] = (elem) ? elem.textContent : '';
|
||||
} else if (attr === '#href') {
|
||||
this.newValues[attr] = getHref(elem);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user