Category "javascript"

React-Tooltip not displaying until page is refreshed

Bit of a weird one here. My website is virtually done, there is just one issue. I've implemented tooltips, but they only display once I refresh the page! Here i

Variable not displaying on Screen

I've set condition for when a user enters numbers into a text box depending on what the numbers entered start with on screen it should display the name of the c

How to write custom select/checkmark logic for material-table, to include selected rows inside of detail panel nested material-table

I have a material-table component where I am rendering a nested materiel-table in the detail panel of each row. I would like to know if there is a way to includ

how to create a user in postgres to connect to nodejs?

It is my first time using postgres and I am trying to use it with node. I installed postgres in Ubuntu and created the user admin sudo -i -u postgres createuser

How to make an arrow function in react so that it executes only once and saves the data in sessionStorage

I am developing an application in react.js and I need to implement a request to Active directory to extract the information of the logged in user, through Micro

Javascript method to capitalize the first letter of every word and also every word after hyphen or dash

I need a JavaScript method to allows me to convert the first letter of every word in a string to a capital letter like this: mike tyson wayne to Mike Tyson Wayn

Chromium bug when input has focus and affects hyperlink text font weight on black background

I found a slight glitch in the hyperlink anchor tag text block. When you have a black background and have focus on an input and a hyperlink to the right or unde

Typescript error TS2583 Cannot find name 'Set'

I have just started learning Typescript today and when I run tsc app.ts I get 11 errors but I thought I would start with the first. Tried updating tsconfig.json

How to calculate window width based on getBoundingClientRectAsync values of another element?

Is it possible to calculate viewport or window width based on getBoundingClientRectAsync values of element which is in virtual DOM? Running JS in web worker (am

React webpage refreshing every 4-6 seconds

I'm not really sure even what part of my code to show because it's such a general error, but everytime I npm start my React webpage it automatically goes from t

How to download CSV from a nested object in javascript?

I want to iterate over an object in Javascript and create a CSV file from its internal objects. const list = { "right": { "label": "Right",

Objects and comparing in Javascript, how to pass the value into the method

I got this Javascript exercise. I couldn't figure out how to pass the value of the pay of each person into the "comparePay" method. I'd be glad if you help me t

How to target props of a component already nested inside another component

I am trying to render a different component in my App.js based on an OnClick placed in a button nested inside my Home component. Essentially I want the Home com

Javascript: Cypress: select sample with not contain value

I want to select a random value from a dropdown, with the restriction that a specific value should not be selected. const initialOrderReason = cy.xpath("//t

Custom hook not updating in component

I have a custom hook that looks roughly like this: export default function useMyHook() { const [foo, _setFoo] = useState([]); const [bar, setBar] = useState

Snapchat OAuth: invalid code_verifier

I'm running a vanilla OAuth flow with PKCE to get a user access token from Snapchat. The initial request is straightforward. I generate a PKCE pair in my Python

Heroku Error. Cannot find module 'Mongoose'

For some odd reason (i have been deployed on Heroku for around 1.5 years) my instance decided to throw a weird error regarding not finding 'mongoose' after atte

Javascript Tensorflow in Chrome Extension not working due to 'unsafe-eval'

I'm trying to update my Chrome Extension to Manifest v3. I use a JSTensorflow Model and it pops this error: Uncaught EvalError: Refused to evaluate a string as

How to target all elements with a specific class in JavaScript

I'm currently working with WordPress and Bootstrap 5. Due to WordPress limitations with the wp_nav_men function. I can't see the markup at all. This means I can

React prop not working on child component

So I have my parent component with some data: const [purchaseData, setpurchaseData] = useState({ tickets: 0, email: "", firstName: "", lastNam