Category "javascript"

IntersectionObserver with React & Hooks

I'm trying to track element visibility with React/Hooks and the Intersection Observer API. However, I can't figure out how to set up observation with "useEffect

How to disable or remove filler in CKEditor 5?

Im currently using ckeditor 5 and it seems that every span that I add it always add <br data-cke-filler="true"> and &nbsp;. I found out that this modu

How can I test google.maps.Geocoder?

Hi! I'm attempting to write a "simple" test to check for a react class component state change. Specifically, I'm testing if the lat(latitude) and lng(longitu

SyntaxError: Cannot use import statement outside a module

I've got an ApolloServer project that's giving me trouble, so I thought I might update it and ran into issues when using the latest Babel. My "index.js" is: req

how to insert data into select2 search input after scan using qrcode

Example results that i want : I already did the qrcode scan and select2. It is working fine. The problem is I want that data "SBD2P3000002" to be searched in

Sort object keys/entries in specific order

I have an object like this: const data = { val5: 1231, val3: 1232, val1: 1233, val2: 1234, val4: 1235, }; And its has to be sorted by it keys but in

How to properly use ref with indiana drag scroll to set initial scroll position

I've been trying to implement the initial scroll from https://codesandbox.io/s/react-indiana-drag-scroll-initial-scroll-getelement-99o6q?file=/index.js:317-382

How would I add a auto scroll feature to this code?

https://codepen.io/hexagoncircle/pen/jgGxKR?editors=0110 I was looking around for cool code to play around with and found this. I tried the classic google the

Add add-to-cart button in Shopify Collections

I have a problem with the ENVY template. This template does not have support for adding a shopping cart button in the collections that are located in the home.

Download file from HTTP response NodeRed

In Node-Red, I'm trying to call an API that provides me with a csv file full of data, I make a http request and get the following return: { "_msgid": "60d0351dc

Nuxt/ESLint - Parsing error: Must use import to load ES Module

I am using Nuxt 2.15.7 in VS Code, using Node version 14.17.1 and the eslint extension. The problem I started seeing a red squiggly line under the 1st character

can you apply media queries in the <noscript/> tag

Hey so im trying to display a message to the user if javascript is disabled using the noscript html tag. the message simply just asks them to re-enable javascri

Can't resolve 'fs' in \node_modules\electron

I am using the electron-react boilerplate and want to use an electron dialog in App.tsx: const { dialog } = require('@electron/remote') //also tried with import

can you apply media queries in the <noscript/> tag

Hey so im trying to display a message to the user if javascript is disabled using the noscript html tag. the message simply just asks them to re-enable javascri

After refresh, firebase Auth current user returns null

Here is my code on profile page, this works fine first time when i redirect from login method of AuthService const user = firebase.auth().currentUser; if (us

JavaScript sorting of an RGB array

This is the task: Colors have to be ordered in such way: Higher Red value first; if the same then: Higher Green value first; if the same then: Higher Blue val

My required field in my form HTML doesn´t work

I have created a in HTML with required fields and then a Submit button with a ng-click=add(). The code is the following:

My required field in my form HTML doesn´t work

I have created a in HTML with required fields and then a Submit button with a ng-click=add(). The code is the following:

Validating array of different object shapes in yup

I am using formik for form validation and came across some problems in array validation. here is my form structure { flow: [ { text: "hello" }, { input:

How to dataLayer.push using GTM Custom Templates?

I have GTM Custom HTML tag that intercepts dataLayer.push called on the page, checks it for Ecommerce and if it is detected send Ecommerce data to remarketing p