@suffolklitlab/alkiln 5.9.0-feat-url2 → 5.9.0-feat-url3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/scope.js +16 -2
- package/package.json +1 -1
package/lib/scope.js
CHANGED
|
@@ -1498,6 +1498,8 @@ module.exports = {
|
|
|
1498
1498
|
}
|
|
1499
1499
|
|
|
1500
1500
|
let handle = await scope.get_handle_from_field( scope, { field: field });
|
|
1501
|
+
// TODO: expect elem to exist
|
|
1502
|
+
expect(handle).to.exist; // I don't think this is sufficient. Maybe in function called above instead
|
|
1501
1503
|
|
|
1502
1504
|
// After each previous input, figure out if this input is (now/still) disabled
|
|
1503
1505
|
// TODO: Consider testing for disabled this before we get the matching row
|
|
@@ -1506,7 +1508,17 @@ module.exports = {
|
|
|
1506
1508
|
// sometimes it blocks nodes from clicks. Scroll item to the bottom instead.
|
|
1507
1509
|
// Note: I'm not sure how we'd get in here if `elem` didn't exist, but
|
|
1508
1510
|
// I once got an error here that I couldn't read `.disabled` of `null`.
|
|
1509
|
-
|
|
1511
|
+
|
|
1512
|
+
// if ( elem && !elem.disabled ) {
|
|
1513
|
+
// elem.scrollIntoView(false);
|
|
1514
|
+
// return elem.disabled;
|
|
1515
|
+
// } else {
|
|
1516
|
+
// return false;
|
|
1517
|
+
// }
|
|
1518
|
+
|
|
1519
|
+
if ( elem && !elem.disabled ) {
|
|
1520
|
+
elem.scrollIntoView(false);
|
|
1521
|
+
}
|
|
1510
1522
|
return elem.disabled;
|
|
1511
1523
|
});
|
|
1512
1524
|
|
|
@@ -1539,7 +1551,9 @@ module.exports = {
|
|
|
1539
1551
|
|
|
1540
1552
|
get_handle_from_field: async function ( scope, { field }) {
|
|
1541
1553
|
/** Get the element's puppeteer handle using the field's selector. */
|
|
1542
|
-
|
|
1554
|
+
if ( session_vars.get_debug() ) {
|
|
1555
|
+
console.log(`scope.get_handle_from_field() field.selector:`, field.selector );
|
|
1556
|
+
}
|
|
1543
1557
|
let handle = await scope.page.evaluateHandle(( selector ) => {
|
|
1544
1558
|
let elem = document.querySelector( selector );
|
|
1545
1559
|
// If the element has a sibling that's a label, we need to
|
package/package.json
CHANGED