Category "javascript"

How to detect submit form button was clicked

I've two button on submit form. 1. Add to Cart Button 2. Buy Now Button I need to add disable class if the button was clicked, submitForm: function (form) {

React .map not re-rendering

I'm building a sorting algorithm visualizer, and in my return, I'm creating divs to represent vertical bars, in animatedBubbleSort() I'm swapping values in the

Codewars Challenge - JavaScript - Find the first non-consecutive number in Array

Link to Codewars challenge This is very basic, but for some reason, I can't figure out why I'm not able to return null when there are not any non-consecutive n

How to fix React Apex Chart initial mount delay?

I am using React Apex chart library in my project.I've figured that the library charts have a small delay before rendering on initial mount. This issue harms th

Why does map mutate array of objects?

Why does map mutate array of objects? var obj = { items: [{ value: 1, selected: true }, { value: 2, selected: false }] }; var items =

How to add dynamically created input field values to a use state array?

Continuing troubleshooting from Adding data to array using UseState onChange Hi, i am trying to make a button, that adds a new input field, then, when i click a

when is the callback passed to setTimeout put on the message queue?

setTimeout(callback, 1000) Is callback put on the message queue after 1000ms or is it put to the message queue immediately? If it is put to the message queue a

ACE Editor Autocomplete to open on `.`

If you enable live autocomplete, the tooltip opens up as you type things. However, it will never open up on pressing . until you type something else after. So

NestJS enable cors in production

I've enabled CORS in my NestJS app following the official tutorial, so my main.ts looks like the following: import { FastifyAdapter, NestFactory } from '@nestj

event.preventDefault() or event.stopPropagation() not working with keyUp event

Directive file: I am trying to do that if my counter goes above two it should stop event or keyUp to reflect but is it not working. Can someone help me on this?

ERR_HTTP_RESPONSE_CODE_FAILURE (HTTP Auth Error 407) on Puppeteer

const puppeteer = require('puppeteer-extra'); const chalk = require('chalk');; const StealthPlugin = require('puppeteer-extra-plugin-stealth'); const modules =

Minifying javascript via unicode

on dwitter.net i often see dweets that are encoded interestingly to minify the JS to character count. for example https://www.dwitter.net/d/22372 (or https://ww

Link tag inside BrowserRouter changes only the URL, but doesn't render the component

I am building a Netflix clone application, and I am using react-router-dom v5 to switch between different pages. However, when I click the Link tag in Navbar.js

How to solve the Gulp error: imagemin.jpegtran is not a function

I am getting this error whenever I try to make imagemin work for any kind of image: 21:54:49] Starting 'imgmin'... [21:54:49] 'imgmin' errored after 47 ms [2

v-bind on link href does not work but only in production (Nuxt static site)

I am trying to bind a generated link to a button. The link is generated based on parameters passed in the URL. The code roughly looks like this: <a :hr

grid-template-columns is not working in React 18

Major Update to the Question(7th May): When I am using my arrow keys, I could see all of the three cards but still the same is as big as it doesn't fit on the s

Flask-socketio, send message only to one chat

I am developing flask app with chat feature. When somenone sends message, it saves into db. Now I want to display it on screen with socketio but when someone s

How do I prevent HTML2PDF from auto-downloading the pdf?

I have a HTML2PDF method in my JavaScript code. The code is working great on one hand as I can open the rendered pdf in a new blob tab and open the print window

firebase.auth().currentUser and onAuthStateChanged always null inspite of being signed in

The firebase.auth().currentUser is always null, as is the onAuthStateChanged listener in my node.js code. However, the user is signed in at my front end swift a

Why window.closed is set to true before the window is closed?

I am trying to use the answer at https://stackoverflow.com/a/48240128/583363. Open a window with window.open and then start an interval to check if it is closed