Bawdy Ink Slinger
KPCKevin Powell - Community
•Created by Bawdy Ink Slinger on 10/10/2023 in #front-end
Are DOM modifications synchronous?
1. If I modify the DOM, can I be sure that that the next line of code has consistent access to that modification?
2. Same question, but for Tasks, microtasks, queues and schedules.
16 replies
KPCKevin Powell - Community
•Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
I wrote some code that keeps erroring saying
click()
does not exist on my testController
object. To troubleshoot, I wrote this code:
Does TestController {}
mean the object has no functions, properties, getters/setters, methods (or whatever word categorizes all of these things), or do I need to pass in different options to see everything on it?87 replies
KPCKevin Powell - Community
•Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
How do I build an API that lets me do `await t.a().b()` & `await t.a(); await t.b()`?
I want to build an API that lets me chain in two ways:
This is known as the builder pattern. Usually it's straightforward, but I'm not sure how to create one when promises are involved.
NOTE: This is the way https://testcafe.io/ 's api works. I'm trying to build a similar api. See https://discord.com/channels/436251713830125568/1158962809401516062/1159217101471481896 (links to a few messages down)
38 replies
KPCKevin Powell - Community
•Created by Bawdy Ink Slinger on 7/8/2023 in #front-end
How to check if an element behind a modal <dialog> is clickable?
1 replies
KPCKevin Powell - Community
•Created by Bawdy Ink Slinger on 4/17/2023 in #front-end
How do you make middle click NOT open a new tab (so I can avoid it)
I notice this a lot on health insurance search results: you search for a doctor and get a list of cards back. I want to be able to middle click each card that seems interesting then look at the details on a second pass. On most websites, this middle a new tab but on these websites it has no effect; the only option is to click one card at a time, changing the entire page, and if it isn't what I was looking for, the back button usually doesn't function correctly and I have to reenter the search.
How do you build this behavior? I'm only asking because I want to figure out how I can turn it off with a user script.
If the answer is, "it depends on the site," here's a specific example: https://www.techjobsforgood.com/jobs/?job_function=Engineering
If you middle click anywhere on the card besides the "View Job," it has no affect. But a left click changes the entire page. What is causing this?
12 replies
KPCKevin Powell - Community
•Created by Bawdy Ink Slinger on 3/19/2023 in #front-end
Responsive grid column count w/o using media queries?
I want a responsive grid where columns shrink and grow to fill the container: on small viewports, I want one column; on medium viewports, I want two columns; and on large viewports, I want a maximum of three columns.
This is easy to do with media queries as shown here: https://codepen.io/academyoff/full/xxaJabZ
But is there a way to achieve this without media queries?
The problem is, even at the smallest viewport, the cells have enough space to collapse into 3 columns.
25 replies