Category "javascript"

Styled Components / React - Style on external element

I'm using Material UI components and MaterialTable and I want to stylish the components using StyledComponents But I not been having the desired results when I

How to access environment variables with vanilla javascript

I have an index.html and I need to pass some sensitive information to some JavaScript variables. This index.html contains plain javascript with jquery so I am s

How to find equivalent text in another with aggregated text?

Given: const textToFind = 'Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, ' const paragraph = 'Lorem Ipsum has been the

How solve Codility equiLeader challenge

After finding the "leader" I tried finding the possible equiLeaders in the given array but couldn't. Tried to find a solution of someone else but can't wrap my

Failed to execute 'createPattern' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0

I'm trying to make a loupe for a canvas project and I'm trying to make a pattern that involves copying part of the canvas that contains the image copy to a seco

A component is changing an uncontrolled input of type text to be controlled error in ReactJS

Warning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vi

Monaco editor dynamically resizable

I have been searching for a discussion about if it's possible to mimic the html tag textarea's resizing when using Monaco Editor's field all over the Internet b

Using a method with v-model in vue

I have a question about using vue's v-model with a method instead of computed. I know we can't exactly do that based on what I see here: How to bind a v-model w

Given an array of integers, find the pair of adjacent elements that has the largest product and return that product

Given an array of integers, find the pair of adjacent elements that has the largest product and return that product. and here is my code function adjacentEle

history.pushState() not working properly on phone

I have a chap app where user first fills up a form then they are redirected to the chat page. Now the problem is when user clicks the back button they goes back

replacing tag with another tag targeting class

Trying to change the h3 tag to a <button> tag targeting via .container and .button-1 class using JavaScript. Unfortunately, it only targets the first h3

Enter with @keyup event not working in Vue

I am trying to call method on pressing enter key but it's not working. Code is as below. <template> <div> <button @click="callEvent" @keyu

Is there a way to reorder "div" elements ,into a descending order, in the DOM according to their content with the onclick of a button?

I am trying to reorder the "divs" (pushed into the DOM via Javascript) with the onclick of a button. Specifically, I'm looking for a Javascript function to reac

React Native Expo: Barcodescanner camera doesn't rotate when i press the rotate button

I'm using React Native Expo. Currently i'm trying to make an application which uses a barcodescanner for scanning QR-code objects. I've implemented a turn camer

How to use JSX in data, computed, methods in VueJS SFC

I'm setting up an app for study. From React, I've known how to use JSX and when I'm writting in VueJS, I don't know how to use it here. <template> &l

You need to enable JavaScript to run this app

I have developed an api with node and mongo. When ever i try to access my api i get the error"You need to enable JavaScript to run this app." Although the ja

Retrieve env variables in Strapi plugin

I develop a Strapi local plugin but I'm unable to retrieve variable defined in my .env file at the root of my project. I try to load this value in my React comp

"React has detected a change in the order of Hooks" but Hooks seem to be invoked in order

I am trying to use Context and Reducers via React's hooks, and running into problems with the order of the hooks not being constant. My understanding was that a

document.getElementById "not defined" in Google Apps Script [duplicate]

I am currently working on a Google forms addon. The addon has a sidebar with an input field and a button. The ID of the input field is "emaili

How convert input type="date" in a timestamp?

I need to convert an <input type="date"> value in a timestamp. This is my HTML code: <input type="date" name="date_end" id="date_end"> This field