Category "javascript"

How to open and close Ember Power Select from outside

I'm aware of this question, but is not complete. I want to open and close the dropdown from outside. I can dispatch a mousedown event when click on my wrapper

How to do cache busting in Rollup.js?

In my project, I need to do cache busting, since after a new deploy, the browser often only reloads the HTML but not the JS & CSS files. Currently, I am not

How do you insert HTML into a QuillJS?

Is it possible to insert raw HTML into a Quill? I've been searching the documentation but couldn't find anything. If it's not possible, can I at least convert

How do I use a for loop to manage increments of an object property in JavaScript?

I’m doing a rockPaperScissors project. Here’s the published link: https://george-swift.github.io/rockPaperScissors/. I want to add a first to 5 feat

Storing React form data in a nested object with useState

I'm building out a form with React, and I want to store the form fields in an object with nested data like this: { name: "Test User", email: "[email protected]

Wait seconds before running next task on scripts package.jscon

What I want to do is when I run npm run dev to execute those both tasks I need to wait for 5 seconds until next task runs. Run the npm run server wait for 5 se

how can we run drag and drop codes with the help of html, css and a bit of javascript? [closed]

<!DOCTYPE html> <html> <head> <title>My Web Page</title> <script> functio

THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera. error

My code is below: This gives me the following error: I cannot resolve this error can anyone help me out? Does it mean that perspectivecamera is no longer an i

Does the .includes method in JavaScript loop through the array and case O(n)?

Does the .includes method cause O(n^2) when run with another loop such as in this simple example? function myFn(){ let age = people.map(person => {

Assigning value to a variable and sending it to NodeJS server

I am trying to assign a value to a variable by getting the input from the html form and then sending it to my node js server, but the problem is that when the v

How to merge cell in react-table

I am using react-table and want to merge cell of specific cells based on their number inside. It likes remove divider border. it looks like this: https://i.img

Chrome Dev Tools Elements Tab stopped working (can't right click any DOM Node and hover over Dom Node doesnt highlight anything)

In the Elements Tab of Chrome Dev Tools I can't right click any DOM Node anymore. I'm talking about the following menu that right click usually opens: Furtherem

Different function gets passed to useEffect on every render? - ReactJS useEffect

I was going through useEffect from reactjs docs and I've found this statement here Experienced JavaScript developers might notice that the function passed to u

Problem to use VueI18n outside a component

I'm trying to use i18n outside a component I've found this solution https://github.com/dkfbasel/vuex-i18n/issues/16 telling to use Vue.i18n.translate('str'), bu

JSX Text Input doesn't work if it has an onChange property (React)

I'm having an issue where any text input that has an onChange property will not let me type in it. I still do have a milisecond of time that I can type somethin

How to get almost increasing sequence of integers

Given a sequence of integers as an array,i have to determine whether it is possible to obtain a strictly increasing sequence by removing no more than one elemen

how to get data from graphql server using react and react-apollo?

After about 6-8 hours trying, I'm resorting to help. All I want is to query my graphql server and the response data to be entered into my react component as pro

why sequelize beforeUpdate hook doesn't work?

I have a simple user model with 2 hooks. User.beforeCreate(setSaltAndPass) User.beforeUpdate(setSaltAndPass) the first works perfectly but the beforeUpdate doe

How to set initial state for useState Hook in jest and enzyme?

Currently Im using functional component with react hooks. But I'm unable to test the useState hook completely. Consider a scenario like, in useEffect hook I'm d

Firebase auth gets stuck on iOS login without error

I've set up the most basic implementation of firebase auth login with email and password. firebase.auth().signInWithEmailAndPassword(email, password).then(() =&