« first day (4920 days earlier)      last day (252 days later) » 

14:00
Non-programming question: Does anyone else find it extremely difficult to wake up at a normal time? Like 8:30AM? It basically takes all of the energy on the planet to wake up at this time for some reason. Maybe it's just me.
14:38
eh, just figure out what time works for you and get a job that fits your schedule
:p
i start at 9 every day
much better than the 7:30 at my first job
 
1 hour later…
15:40
@ParkingMaster Not any more. I used to but eventually just, dunno, stopped oversleeping. I used to set an alarm with snooze every 5 minutes (not enough time to fall completely back to sleep) and only set 3 snoozes (to keep me from snoozing). But nowadays, I have an alarm for 7:20 and I never snooze it, just get up. Often I even wake up earlier and if it's, say, up to 20 minutes before the alarm, I just get up instead of falling back to sleep.
16:06
Guess it is just me then. Most of the time I hear my alarm go off but I'm in such deep sleep that I just ignore it. It's annoying because I wish to start my day earlier.
 
3 hours later…
19:06
posted on April 05, 2024 by Ben Mason

The Dev channel has been updated to 125.0.6396.3 for Windows, Mac and Linux. A partial list of changes is available in the Git log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Prudhvi Bommana Google Chrome

@ParkingMaster You should try waking up later! I HATE mornings, so I moved to EST – all my clients are in PST so I start my day at 9am PST (aka 12pm EST), genuinely one of the greatest decisions I have ever made
@joshorrom Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
19:58
Is there a reasons I can't set properties to primitive values on the dataset object?
htmlElement.dataset.inProgress = true;
Type 'boolean' is not assignable to type 'string'.ts(2322)
(index) DOMStringMap[string]: string
What I would have expected is that it would accept all primitives and convert them to string for me but it seems not so
mdn says, "When setting values, the value is always converted to a string"
...ok so um...
htmlElement.dataset.inProgress = "true";
...so that works. i guess i was looking for confirmation or if there was a method that I could call would do the conversion to string
Hi Guys, I'm sure it's probably just a typo somewhere but I just can't spot it. I have a grid of boxes, and I am adding a CSS class to a box on click and removing it and applying to another box when that box is clicked and that works fine swapping between them, but I cannot seem to get a reset button to return to the original state working, for some reason the classlist.remove() is not working
growButton(button:string){
  var boxesGrid = document.getElementById('faq-support-boxes-grid');
  boxesGrid!.classList.add('faq-support-boxes-grid-click');
  this.removeButtonClickState(boxesGrid!);
  var clickedButton = document.getElementById('feature-box-'+button);
  clickedButton!.classList.add('feature-box-click');
  clickedButton!.querySelector('img')!.style.display = 'none';
}
resetButton(){
  var boxesGrid = document.getElementById('faq-support-boxes-grid');
  boxesGrid!.classList.remove('faq-support-boxes-grid-click');
typo:
` var childElements = boxesGrid!.querySelectorAll('.feature-box-click');`
boxesGrid is being passed to removeButtonClickState but you have boxesGrid! in your code
20:15
doesn't change anything
if you're referring to the boxesGrid! inside removeButtonClickState()
what is the ! mark for?
its in angular so its to get around the complier thinking its possibly null
can you try using querySelector() instead of query selectory all?
also, in your forEach() can you print out the child id so make sure you're looping through all of them
also, adding a try catch around the reset button code can catch some errors or keep the console open
make sure the reset button is not inside the box grid (obvious things i know)
20:31
printing the element works
resetButton() {
  console.log("Reset button called");
  const boxesGrid = document.getElementById('faq-support-boxes-grid');
  if (boxesGrid) {
    console.log("Element found, removing class...");
    boxesGrid.classList.remove('faq-support-boxes-grid-click');
    this.removeButtonClickState(boxesGrid);
    console.log("Class removed successfully");
  } else {
    console.error("Element with ID 'faq-support-boxes-grid' not found.");
  }
}
even this logs that the class has been removed
if there are more than one image in your child element this line may break it:
child!.querySelector('img')
@1.21gigawatts Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
theres only 1 image but commenting that line still doesn't work
@1.21gigawatts Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
removeButtonClickState(boxesGrid:HTMLElement){
try {
  var childElements = boxesGrid!.querySelector('.feature-box-click');
  childElements.forEach(child => {
    child.classList.remove('feature-box-click');
    child!.querySelector('img')!.style.display = 'inline';
  });
} catch(error) { console.log(error) }
}
20:35
the strange thing is clicking another box removes the class from the first
if you are stuck longer, create a code pen example
I am trying to make it now
also, add console.log(child.id) to the forEach loop
actually, try just getting the child elements of the boxGrid
suggestion: you might want to make your class names constants so that you can avoid typos
{
const FEATURE_CLASS = "feature-box-click";
}
20:57
your reset button is inside your boxgrid
so i think you are adding the class after removing it
but you want to step through the code and see
in your reset button add the event and stop the propagation
resetButton(event) { event.stop*() }
onclick="resetButton(event)"
function resetButton(event) { event.stopImmediatePropagation();
does the button being inside the grid have an impact?
because the click event arrives at the back button click handler and then it continues on to the container click handler
oh yes of course
21:03
the back button removes the class and then the row event handler adds it back on
knew it would be something silly
21:31
I think I should be able to get a solution working with :focus and :active on the box divs and :focus-within on the parent grid
@1.21gigawatts It's just String.
||> String(true)
Invalid command! Did you mean: forkingmouse, nine+ten, translate2? Try help for a list of available commands..‍.‍
@VLAZ 'true' Logged: [ ] Took: 0ms
You can also use .toString() but it's not null-safe
i ended up setting it to "true" instead of true
i had thought though that setting the property it would convert it internally (via proxy
or other) but if not that's fine
21:53
It does get converted internally. However, TS still stops you from using that implicit conversion because it demands proper typing.
@VLAZ ok makes sense
22:12
@VLAZ wait, i don't know if it makes sense
if the api allows other types to be assigned to it and converts them internally then it should allow it

« first day (4920 days earlier)      last day (252 days later) »