Category "javascript"

CDK drag-drop is not working in Tablet device

I'm trying to use the Angular Material CDK Drag-Drop module from https://material.angular.io/cdk/drag-drop/overview It is working in desktop device but it is no

Trying to loop through firebase and display each object as a card React

My data is structured like so [1]: https://i.stack.imgur.com/dWsr3.png I am trying to loop through the database and put the data from each card into props for m

Next.js Navbar gives a warning of Target Element not found when clicked

I am currently working on a next.js app, which contains a connect wallet button found to the right of the navbar, with the navigation links to the left of the n

Firebase logs "undefined" on console when it should not

I am using firebase 10.9.2 (Latest version) I use the onValue function to go through the data in my live database. For some reason, it always logs (and is set t

Javascript Custom Array.prototype.method logs 'not defined' [duplicate]

So, I've never done this before, trying to add a method to the Array.prototype. See console.log statement below for usage. It keeps telling

How to move local File object in and out of Shared Array Buffers JS

I have a web worker running in a while(true) loop, the code is too deep to change it at this point in time. The worker can access a Shared Array Buffer, I have

Is there a way to override what useMemo does to determine if there's a change?

useMemo(() => expensiveFunction(), [deps]) re-executes the expensiveFunction when the deps have changed. I was wondering... is there a way to control how Re

Disabling Ctrl+T in web browsers

I'm stuck with a shortcut problem. Javascript is not a language I've used much, and the answers I've searched didn't help. I'm creating some tutorials for a spe

Gender radio input and fields of interest checkbox undefined in alerts

Can anyone help me why the gender and fields of interest output are undefined? I can't seem to get it no matter how I get the value and its getting out of hand

Add Button to Modebar to display in Fullscreen (Plotly JS)

I would like to add a custom button to the plotly graph to make the graph full screen. I have seen some solutions for the programming language 'R' but I did not

Schema for saving a lot of questions MongoDb

If I have a survey application for child tracking what is the best way to save survey questions in MongoDB? Knowing that survey is divided into stages (about 12

What are my options to deal with this stale closure in React besides using ref

I'm using the library React Datasheet Grid, the main component has a property called OnActiveCellChange, to which i'm passing my custom function: const [selecte

How to use the visibilitychange event to display messages when tab is hidden?

When an customer opens a new tab or goes away from the current sites tab, I'm trying to insert an promo message in the tab of a browser that flashes back and fo

How to add random minutes like first slots should be 30 minutes and then 1 of 15 minute slot and again 30 minute slot

const eventClick = (args) => { let StartTime = moment(args?.event?.StartTime, 'HH:mm ') let EndTime = moment(args?.event?.EndTime, 'HH:mm ') if (

mocking database calls in api routes

I am building a full stack application with NextJS and a MySQL database.In my API routes I make calls to this database (for example, createOne() for creating an

use ck editor in dark mode. works perfectly in light mode

I am beginner in vue and i want to use ck editor in dark mode it works perfectly in light mode but i am not able to make it in dark mode. documentation link fro

How to make Categories button functional

I got my current website displaying hard coded data from my data.js file. I implemented firebase as my database and I want to have my categories button work wit

Construct signatures with JSDoc and TS-Pragma ts(2351)

I've a function that returns a constructor dynamically. When I try to instantiate the new object it warns me This expression is not constructable. Type 'myConst

Insert tab character into SlateJS text editor

How to insert tab characters into SlateJS? So inserting   is a tab character, however, when inserting this as text, it appears as the literal character

Plucking specific substring from string - Javascript

I have a dynamic string that is generated like one of the following: var q = "FROM Table SELECT avg(1), avg(2), avg(3) where x='y' var q = "SELECT avg(1), avg(2