Blocs for Mac V5.2 Beta Build 11 😅

So I am working on NavPlus, and I have a keydown event listener, only I find I get an error, because suddenly its looking for lightbox (which is not being used in the dev project) with the blocs javascript :rofl:

My code is…

 keyboardNavLink.addEventListener('keydown', (event) => {
    if (event.key === 'Enter' || event.key === ' ') {
        // doing stuff
    }
}

What’s the solution here? :man_shrugging:

I’m not sure, the blocs.js includes the event listener for keydown for navigation of light box, so there is obviously a conflict here between your code and the default Blocs code.

I may be able to adjust the event listener for light boxes, so it’s harder to conflict with from other JS.

This would need a week or so of testing, so I’ll come back to this in V5.2.1.

Is it because blocs is apply the event listener to the entire window. I’m only on particular nav items?

Edit:
I had a late night thought, I will give adding event.stopPropagation() a try tomorrow. It may need to be added to the blocs js too??

1 Like

Yeah that function captures all keyboard events. But right now it doesn’t check for light box existence, which I’ll change.

1 Like

Using event.stopPropagation(); in my event listener seems to stop the blocs.js triggering an error.

2 Likes

@Norm

Thanks for the help with the bugs - your efforts are making it so much better! I left a final comment in ticket #24344

Thanks,

Bill
BricsDesign

1 Like

Hi Norm:

I was scrolling through the impressive list of new features (and fixes) and I don’t see a “Copy All” option for adding images to the Asset Manager.
We traded e-mails on this a while back, and I was hoping to see it in the 5.2 release.

Just trying to get this back on your radar.

Thanks

Rich the Weather Guy

Sorry, not everything can make it in.

My suggestion would be to get more involved in the testing if you have time.

Just realised, beyond navigating with keyboard (which I have solved for NavPlus), when you close an Offcanvas with Esc, it will obviously throw the lightbox js error too.

I will wait until you amend the blocs.js before I do any more around the error. Because I don’t want to create a bunch of event listeners just to avoid this. Especially when it affects any website built with Blocs and a user using accessibility assistance.

Hey, @norm.

It’s impossible to use 2 different font weights. And no, using !important is not solving the problem.