What does react docs mean by “… pass this.props.onChange directly to Chosen …” in the article “Integrating with jQuery Chosen Plugin”?

I am going through the react documentation article of integrating-with-jquery-chosen-plugin, and there they mention:

We won’t pass this.props.onChange directly to Chosen because component’s props might change over time, and that includes event handlers. Instead, we will declare a handleChange() method that calls this.props.onChange, and subscribe it to the jQuery change event

This doesn’t make sense to me, because they are already using(passing as prop?) onChange on Chosen in <Chosen onChange={value => console.log(value)}>. Here’s the code the docs use just after:

function Example() {
  return (
    <Chosen onChange={value => console.log(value)}>
      <option>vanilla</option>
      <option>chocolate</option>
      <option>strawberry</option>
    </Chosen>
  );
}

It appears to me that the docs wanted to say:

We won’t pass this.props.onChange directly to Chosen select because [Chosen]component’s props might change over time, and that includes event handlers(onChange?).

But still I don’t grasp the meaning of props including event listeners might change. The only prop that might change here is the children prop, which would affect select‘s {this.props.children}. Why would the onChange event listener change?

Can someone please elaborate upon what the docs are trying to say.

Is there a way to get part of a text node using 2 x,y coordinates from a DomRect

I am creating a list of DomRects like below where the element is just a paragraph. I am getting DomRects with x any y coordinates which could be text nodes or i tags. I can get the i tags with the x and y coordinates using document.elementFromPoint(x,y) but how would. i get a text node with the x and y coordinates.

    let range = document.createRange();
    range.selectNodeContents(element);
    let elementRectangles = range.getClientRects();
    for (let i = 0; i < elementRectangles.length; i++) {
            let elementRectangle : DOMRect = elementRectangles[i];
//document.elementFromPoint(elementRectangle.x,.elementRectangle.y) this can get i tags, b tags etc
//how do i get text nodes with the coords

    }

Query regarding without Isolate::Scope isolate_scope(isolate) I see a crash

I have a DLL with init, deinit, start, stop, methodcall methods. There is only one isolate scope.In init, I register the platform

    platformZ = platform::NewDefaultPlatform();
    V8::InitializePlatform(platformZ.get());
    V8::Initialize();

In start I create the isolate

// Create a new Isolate and make it the current one.
    isolate = Isolate::New(create_params);
    Isolate::Scope isolate_scope(isolate);
    // Create a stack-allocated handle scope.
    HandleScope handle_scope(isolate);
..
    Local<Context> context = Context::New(isolate, NULL, global);
    Context::Scope context_scope(context);

In methodCall, I find the instance of MyClass and call myMethod in it. If I don’t call isolate_scope, the is a crash after making around 100 calls to myMethod, I get an exception 0xC0000005: Access violation writing location 0x00000000. When I call isolate_scope, the exception does not happen.

  Isolate::Scope isolate_scope(isolate);    
 // Go into the existing scope     
  HandleScope handle_scope(isolate);

I don’t exit the scope by any other instructor. Could someone please tell me why isolate_scope makes it work?. In all the samples, isolate_scope is not used in method calls. My understanding is that isolate_scope is not needed since there is no other scope.

hello guys, please tell me why the code does not work and does not output to the console, and also why the first line is highlighted

     `<html>

      body>  </body>
       <script>
      console.log()


     console.log(43352453234234234234234234234234442)

    let aaa = confirm("your question")
    consol.log(aaa)

    let abbs = prompt("Your question")
   alert(abbs);



     </script>

    </html>`

hello, i don’t know english so i use a translator, sorry for the mistakes
I just started learning js and need your help, why is the first line with highlighted? Gives

the task was to output empty space to the console first, then use confirm to use a large number, save the result to a variable and output it to the console, and the last ask the user to enter a question, and then ask him this question.
j

Jump to an anchor on the same page

I have a page of HTML which has explanatory text first, followed by buttons to select what the user wants displayed on the page. The buttons use onClick to invoke a JavaScript program to do the display. Example:

<button onClick="displayDVDTitles('CurrentYear')">This Year's DVDs</button>

The displayDVDTitles routine does its thing and places its results on the area of the page further down where an ID is specified using appendChild. Works fine … except that I would ALSO like to MOVE the page down to the point where the information is displayed.

How would I do that? Thanks. (If you need to see the page, it is https://adp.acb.org/dvds.html.)

Fred

Swiper not showing background image from local directory in react

I tried adding image from the project local repo called “images” and use it as background image in the swiper carousel, but the image is not displaying. It’s showing only the and

write-up. The background image is not showing. The write up suppose to be on top of the image and slide along with the image. Here is my code. Please I need help in resolving the background image issue.

<section className="site-section pt-5 pb-5">
  <div className="container">
    <div className="row">
      <div className="col-md-12">
        <Swiper
          spaceBetween={30}
          centeredSlides={true}
          autoplay={{
            delay: 2500,
            disableOnInteraction: false
          }}
          pagination={{
            clickable: true
          }}
          navigation={true}
          modules={[Autoplay, Pagination, Navigation]}
          className="mySwiper"
        >
          <SwiperSlide>
            <a
              href="blog-single.html"
              className="a-block d-flex align-items-center height-lg"
              style={{
                backgroundImage: "url('src/images/img_1.jpg')"
              }}
            >
              <div className="text half-to-full">
                <span className="category mb-5">Cybersecurity</span>
                <div className="post-meta">
                  <span className="author mr-2">
                    <img src="src/images/person_1.jpg" alt="author" />
                    Sneid{' '}
                  </span>
                  {'. '}
                  <span className="mr-2">June 20, 2022 </span>
                  {'. '}
                  <span className="ml-2">
                    <span>
                      <CommentIcon sx={{ fontSize: 14 }} />
                    </span>
                    {' 3'}
                  </span>
                </div>
                <h3>How to protect yourself in the cyber world</h3>
                <p>
                  Lorem ipsum dolor sit amet, consectetur adipisicing
                  elit. Quidem nobis, ut dicta eaque ipsa laudantium!
                </p>
              </div>
            </a>
          </SwiperSlide>
        </Swiper>
      </div>
    </div>
  </div>
</section>

Why looping through the array backwards is not returning reversed array of strings until I assigned it to the original array?

So I was doing this coding problem and where you have yo return reversed array of strings.

/**
 * @param {character[]} s
 * @return {void} Do not return anything, modify s in-place instead.
 */
var reverseString = function (s) {

};

where s is an array of string.

Example
Input: s = [“h”,”e”,”l”,”l”,”o”]
Output: [“o”,”l”,”l”,”e”,”h”]

I have done this

/**
 * @param {character[]} s
 * @return {void} Do not return anything, modify s in-place instead.
 */
var reverseString = function (s) {
      let arr = [];

     for (let i = s.length-1;i >= 0; i--){
         arr.push(s[i]);
     }
     return arr;
};

But this is the wrong solution. IDKW?

After I did this:

/**
 * @param {character[]} s
 * @return {void} Do not return anything, modify s in-place instead.
 */
var reverseString = function (s) {
    let reversed = [];

    for (let i = s.length - 1; i >= 0; i--) {
        reversed.push(s[i]);
    }

    for (let i = 0; i < s.length; i++) {
        s[i] = reversed[i];
    }

    return reversed;
};

It runs perfectly can you explain why the upper one is not executing correctly, why it is pushing the elements in the array as the original one instead of putting in reversing order.

Debug Microsoft teams web application to understand read receipts feature implementation

As we are bringing in new feature in our existing chat web application which is read receipts, we have implemented the necessary changes. Below point are simple flow of how read receipts works in out chat app.

  • We observe visibility of each message using IntersectionObserver.
  • Collect all the message ids which are read by the user.
  • Make an api call to server to store information and everyone in the chat gets update via pusher webscoket connection.

The main problem we faced while implementing read receipts is the visibility change of browser tab. We listen to visibilitychange event, which is not accurate in most of the times such as, if the application is visible or not, if the window focus is lost for another window, but not the actual visibility on the screen? what about different kinds of visibility lost, like ALT+TAB, WIN/MAC key (start menu / dash), taskbar/dock actions, WIN+L (lock screen), window minimize, window close, tab switching. What about the behaviour on mobile devices?

So I did some google and found a workaround to address this persisting issue Here

Now comes a question, How efficient this solution would be ? How it will affect the performance of my web application ?. Hence I thought of debugging Microsoft teams web applications to see how read receipts is implemented. I tried to see dev-tools, unfortunately nothing worked out for me in order to understand how teams implemented this feature. I looked in to api calls, websokcet even service worker. I hit nowhere. So I now come here to ask how read receipts is implemented by teams web app ?

Tech Stack;

  • ReactJs
  • Redux
  • Pusher for websocket.

does html url eocoding prevent xss attack?

I’m black box testing my website, it’s a small website without any input and form. But it has a function that might cause xss attack. For example if the website is abc.com and you enter abc.com/alert(“xss”) it will show this

HTTP ERROR 404 Not Found
URI:    /%3Cscript%3Ealert(%22xss%22)%3C/script%3E
STATUS: 404
MESSAGE:    Not Found
SERVLET:    -

and the source code for this is

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr><th>URI:</th><td>/%3Cscript%3Ealert(%22lol%22)%3C/script%3E</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Not Found</td></tr>
<tr><th>SERVLET:</th><td>-</td></tr>
</table>
</body>
</html>

you see that I was trying to prevent it from xss attack by converting xss script to html percentage url code. So is there anyway for other people hack with this? I’m sorry for my english level, I’m not native English speaker, also I understand that there is already a similer stackoverflow quastion about this, but it does not really tell me if there is another way for hack this.

Defining initial coordinates for nodes with children in a D3JS animation

I have SVG nodes that I defined as <g> elements that contain one <circle> and one <text> inside them.

Here’s an examples HTML:

<g class="nodes">
    <g>
        <circle r="63"></circle>
        <text class="true">Croatia</text>
    </g>
(...)

I am animating them in d3js as to achieve a circular packing effect, using forces. All is working well, I just am not at all able to define the initial coordinates for my elements. The elements starting position is top right, and I would like them to be in the center of my SVG area when the animation starts.

I have tried giving “x, y” attributes, as well as transform: translate them before the animation starts, to no avail.

I have created an animations with:

simulation.on("tick", tickActions);

and animated it using:

function tickActions() {
    //update g transform:
    node.attr("transform", function (d) {
      return "translate(" + [d.x, d.y] + ")";
    });
}

Any idea how I could make sure the nodes start animating from center outwards?

SVG PATH to curve borders between sections works wrong on mobile devices

In the website I am coding I used svg path to curve the border of both top and bottom sections of the webpage. Everything seems to work good when I use large screens, but if I try with mobile devices the curve sticks too up (or too down) and cover the text inside the section. Any idea how I can fix this? I would like to maintain this design also for mobile devices. To let understand better my problem here I placed some pics

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

body {
  font-family: "Rubik", sans-serif;
  color: #444;
  padding: 0 /* 1rem */;
}

/* -------- NAV2 ----------- */

.header {
  width: 100%;
  height: 8rem;
  padding: 0.6rem;
  border-top: 0.5rem solid #fff;
  background-color: #f2a900;
  display: flex;
  /* flex-direction: row; */
  justify-content: space-between;
  align-items: center;
}

.header2 {
  width: 100%;
  height: 8rem;
  padding: 0.6rem;
  border-top: 0.5rem solid #f2a900;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 999;
  box-shadow: 0 1.2rem 3.2rem rgba(0, 0, 0, 0.03);
}


.logo2 {
  height: 5.2rem;
}

nav ul {
  height: 100%;
}

.header ul,
.header2 ul {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.header ul li,
.header2 ul li {
  font-size: 1.6rem;
  padding-right: 1.8rem;
  list-style: none;
  text-decoration: none;
}

/* -------- Header primary ----------- */

.main-nav-link2 {
  text-decoration: none;
}

.main-nav-link2:link,
.main-nav-link2:visited {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  font-size: 1.8rem;
  transition: all 0.3s;
}

.main-nav-link2:hover,
.main-nav-link2:active {
  color: #fceecc;
}

.main-nav-link2.nav-cta2:link,
.main-nav-link2.nav-cta2:visited {
  padding: 1.2rem;
  border-radius: 0.5rem;
  color: #fff;
  background-color: #da9800;
}

.main-nav-link2.nav-cta2:hover,
.main-nav-link2.nav-cta2:active {
  background-color: #c28700;
  color: #fceecc;
}

#hamburger-icon2 {
  margin: auto 3rem auto 0;
  display: none;
  cursor: pointer;
}

#hamburger-icon2 div {
  width: 35px;
  height: 3px;
  background-color: #fff;
  margin: 6px 0;
  transition: 0.4s;
}

/* ---------- Header Secondary ----------- */

.main-nav-link {
  text-decoration: none;
}

.main-nav-link:link,
.main-nav-link:visited {
  text-decoration: none;
  color: #f2a900;
  font-weight: 500;
  font-size: 1.8rem;
  transition: all 0.3s;
}

.main-nav-link:hover,
.main-nav-link:active {
  color: #c28700;
}

.main-nav-link.nav-cta:link,
.main-nav-link.nav-cta:visited {
  padding: 1.2rem;
  border-radius: 0.5rem;
  color: #fff;
  background-color: #f2a900;
}

.main-nav-link.nav-cta:hover,
.main-nav-link.nav-cta:active {
  background-color: #c28700;
  color: #fceecc;
}

#hamburger-icon {
  margin: auto 3rem auto 0;
  display: none;
  cursor: pointer;
}

#hamburger-icon div {
  width: 35px;
  height: 3px;
  background-color: #f2a900;
  margin: 6px 0;
  transition: 0.4s;
}

.open .bar1 {
  -webkit-transform: rotate(-45deg) translate(-6px, 6px);
  transform: rotate(-45deg) translate(-6px, 6px);
}

.open .bar2 {
  opacity: 0;
}

.open .bar3 {
  -webkit-transform: rotate(45deg) translate(-6px, -8px);
  transform: rotate(45deg) translate(-6px, -8px);
}

.open .mobile-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: rgba(255, 255, 255, 0.9);
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 7.5rem;
  left: 0;
  height: calc(100vh - 50px);
  width: 100%;
}

.mobile-menu li {
  margin-bottom: 10px;
  padding-bottom: 2rem;
}

/* ----- start main header dropdwon menu ------- */

.open .mobile-menu2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: hsla(42, 100%, 47%, 0.8);
}

.mobile-menu2 {
  display: none;
  position: absolute;
  top: 7.5rem;
  left: 0;
  height: calc(100vh - 50px);
  width: 100%;
  z-index: 999;
}

.mobile-menu2 li {
  margin-bottom: 10px;
  padding-bottom: 2rem;
}

/* ------ end main header dropddown menu --------*/

.hide {
  opacity: 0;
  left: -100%;
}
.show {
  opacity: 1;
  left: 0;
}

h1 {
  display: inline-block;
  animation-name: moveInLeft;
  animation-duration: 2s;
}

.price {
  font-size: 24px;
  font-weight: bold;
}

.hero {
  display: flex;
  flex-direction: column;
  place-items: center;
  padding-top: 9.6rem;
  position: relative;
  height: 85vh;
  background-image: linear-gradient(
      0deg,
      rgba(242, 169, 0, 0.5),
      rgba(242, 169, 0, 0.5)
    ),
    url(../images/moscow-city.jpg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.value1 h2 {
  font-weight: bold;
}

.hero-txt {
  text-align: center;
  margin: 1.5rem auto;
  font-size: 1.6rem;
}
.hero-txt2 {
  margin-top: 1rem;
  font-size: 1.9rem;
}

.hero-btn {
  padding: 1.6rem;
  background-color: #f2a900;
  border-radius: 1.8rem;
  display: inline-block;
}

.hero-btn:hover {
  padding: 1.5rem;
  color: #fceecc;
}

.hero-btn-container a,
a:visited {
  color: #fff;
  text-decoration: none;
  font-size: 1.8rem;
}

.svg-1 {
  position: absolute;
  bottom: 0;
}

.svg-2 {
  bottom: 0;
  position: absolute;
}

.hero h1 {
  font-size: 5rem;
}

.lang {
  margin: 2rem auto 1.6rem auto;
}

.fi {
  font-size: 3rem;
  border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  opacity: 0.5;
  transition: all 0.4s;
}

.fi:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}
<div class="header" id="header">
        <div id="brand">
          <a href="#">
            <img class="logo2" alt="bitcoin atm moscow logo" src="images/logo.png" />
          </a>
        </div>
        <nav>
          <ul>
            <li><a class="main-nav-link2" href="#about">About us</a></li>
            <li><a class="main-nav-link2" href="#benefit">How to buy</a></li>
            <li>
              <a class="main-nav-link2 nav-cta2" href="#map">Where we are</a>
            </li>
            <li><a class="main-nav-link2" href="#why-box">Why us</a></li>
            <li><a class="main-nav-link2" href="#footer">Contacts</a></li>
          </ul>
        </nav>
        <div id="hamburger-icon2" onclick="toggleMobileMenu(this)">
          <div class="bar1"></div>
          <div class="bar2"></div>
          <div class="bar3"></div>
          <ul class="mobile-menu2">
            <li><a class="main-nav-link2" href="#about">About us</a></li>
            <li><a class="main-nav-link2" href="#benefit">How to buy</a></li>
            <li>
              <a class="main-nav-link2 nav-cta2" href="#map">Where we are</a>
            </li>
            <li><a class="main-nav-link2" href="#why-box">Why us</a></li>
            <li><a class="main-nav-link2" href="#footer">Contacts</a></li>
          </ul>
        </div>
      </div>

<div class="header2 hide" id="header2">
      <div id="brand">
        <a href="#">
        <img class="logo2" alt="bitcoin atm moscow logo" src="images/logo2.png" />
        </a>
      </div>
      <nav>
        <ul>
          <li><a class="main-nav-link" href="#header">Home</a></li>
          <li><a class="main-nav-link" href="#about">About us</a></li>
          <li><a class="main-nav-link" href="#benefit">How to buy</a></li>
          <li>
            <a class="main-nav-link nav-cta" href="#map">Where we are</a>
          </li>
          <li><a class="main-nav-link" href="#why-box">Why us</a></li>
          <li><a class="main-nav-link" href="#footer">Contacts</a></li>
        </ul>
      </nav>
      <div id="hamburger-icon" onclick="toggleMobileMenu(this)">
        <div class="bar1"></div>
        <div class="bar2"></div>
        <div class="bar3"></div>
        <ul class="mobile-menu">
        <li><a class="main-nav-link" href="#header">Home</a></li>
          <li><a class="main-nav-link" href="#about">About us</a></li>
          <li><a class="main-nav-link" href="#benefit">How to buy</a></li>
          <li>
            <a class="main-nav-link nav-cta" href="#map">Where we are</a>
          </li>
          <li><a class="main-nav-link" href="#why-box">Why us</a></li>
          <li><a class="main-nav-link" href="#footer">Contacts</a></li>
        </ul>
      </div>
    </div>

 <div class="hero">
  <div class="lang">
  <a href="index.php" title="русский" class="fi fi-ru fis"> </a>
    <a href="index_en.php" title="english" class="fi fi-gb fis"></a>
    <a href="index_it.php" title="italiano" class="fi fi-it fis"></a>
  </div>

          <div class="hero-txt"><h2>Only 21 millions of Bitcoins will be created and we are more than 8 billions in this world:<br></h2>
           <div class="hero-txt2"> <h2>what are you waiting to get yours?</div></h2>
</div>

<div class="hero-btn-container">
  <a href="#map-box" class="hero-btn">Buy Bitcoin</a>
  </div>



  
       <svg
          class="svg-1"
          xmlns="http://www.w3.org/2000/svg"
          viewBox="0 0 1424 224"
        >
          <path
            fill="#f2a900"
            fill-opacity="1"
            d="M0,32L120,58.7C240,85,480,139,720,138.7C960,139,1200,85,1320,58.7L1440,32L1440,320L1320,320C1200,320,960,320,720,320C480,320,240,320,120,320L0,320Z"
          ></path>
        </svg>
        <svg
          class="svg-2"
          xmlns="http://www.w3.org/2000/svg"
          viewBox="0 0 1440 220"
        >
          <path
            fill="#fff"
            fill-opacity="1"
            d="M0,32L120,58.7C240,85,480,139,720,138.7C960,139,1200,85,1320,58.7L1440,32L1440,320L1320,320C1200,320,960,320,720,320C480,320,240,320,120,320L0,320Z"
          ></path>
        </svg>
        <div class="cta"></div>
      </div>
    </header>
    

. The site is also online at btcatm.ru
Here is [large][1]how appear the website in a large screen (for example through a MacBook)

And here through a small device, for example an iPhone:

[small][2]

Detach listener realtime listener using modular SDK: “Property ‘off’ does not exist on type ‘ DatabaseReference’.”

I’m migrating my Realtime database implementation from Namespaced to Modular. In Modular I have the following working correctly:

const reference = firebase.database().ref(`/projects/${uuid}`);
reference.off();

I have rewritten this to:

const reference = ref(firebase, `/projects/${uuid}`);
reference.off(); 

According to the docs, detaching listeners works the same (https://firebase.google.com/docs/database/web/read-and-write#detach_listeners). So I would expect reference.off() to still work, also in the modular version.

However, it gives the error:

Property ‘off’ does not exist on type ‘ DatabaseReference’.

What am I doing wrong?

I need to search for text in an html file

I have a program that exports an html file that I upload to my web site. There are 2 versions of this file. One has div tags, the other does not. The other has plain text in the body that is displayed to the client and is different from the text in the first file.

I need to determine which version I have gotten, and either upload it or a 3rd file. Grep and sed can’t handle the html file. I have also tried awk. None of these programs will successfully find body text or div tags. At least not as I have tried them.

I am trying to do this using a bash script triggered by Folder Actions. I am on an M1 Mac Mini running Ventura. I have everything else working, but I can’t get a working text search of my html file.

My most recent investigations seem to indicate that this might best be accomplished with javascript. I would appreciate a kick in the right direction.

I tried grep and sed. Neither can find text in the html file. I would like to ask the html which version I have by searching the text in the file and use the results to determine what file gets uploaded.

Frappe Chart and Datatable not loading properly the first time on Edge

I’m trying to create some charts and tables using Frappe Chart and Frappe Datatable included in the Frappe Framework. They work fine on Chrome and Safari, but for some reason it struggles to load on MS Edge the first time the page is opened, or after I clear all the cache. Some charts and tables are loaded, while others display nothing. Here is a screenshot:
first-open

However, if I refresh the page, it displays everything just fine:
other-open

Data in the tables are redacted, but they load correctly.

I thought it was a timing problem, but the problem still persists no mater what I tried.
Here’s the code that I used to create the chart:

frappe.pages['company-snapshot'].on_page_load = function(wrapper) {
    // new MyPage(wrapper);
    frappe.ui.make_app_page({
        parent: wrapper,
        title: 'Company Snapshot',
        single_column: true
    });

    wrapper.company_snapshot = new erpnext.CompanySnapshot(wrapper);

    frappe.breadcrumbs.add("Accounts");
}

erpnext.CompanySnapshot = class CompanySnapshot {
    constructor(wrapper) {
        var me = this;
        // 0 setTimeout hack - this gives time for canvas to get width and height
        setTimeout(function() {
            me.setup(wrapper);
        }, 0);
    }

    load_dom(wrapper) {
        return new Promise((resolve, reject) => {
            $(frappe.render_template("company_snapshot")).appendTo(wrapper.page.main);
            resolve(0);
        })
    }

    // Set up all default elements
    async setup(wrapper) {
        var me = this;

        // Push HTML DOM Elements to page
        console.log("Before")
        const result = await this.load_dom(wrapper);
        console.log("After:" + result);

        // Set up Period Selector
        this.elements = {
            layout: $(wrapper).find(".layout-main"),
            trend_period: $(wrapper).find("#ie-selector"),
            top_customer_period: $(wrapper).find("#top-customer-selector"),
            prev_year_income_period: $(wrapper).find("#prev-year-income-selector"),
            prev_year_expense_period: $(wrapper).find("#prev-year-expense-selector"),
            expense_breakdown_period: $(wrapper).find("#expense-breakdown-selector"),
            refresh_btn: wrapper.page.set_primary_action(__("Refresh"),
                function() { me.get_data(); }, "fa fa-refresh"),
        };

        // Set up default values
        this.options = {
            trend_period: 'this_year',
            top_customer_period: 'this_year',
            prev_year_income_period: 'yearly',
            prev_year_expense_period: 'yearly',
            expense_breakdown_period: 'this_year',
            current_year: new Date().getFullYear(),
            colors: ['green', "#ff1f1f", "orange"]
        };

        this.default_data = {
            labels: [],
            datasets: [
                {
                    name: "Total Sales",
                    chartType: 'bar',
                    values: []
                }
            ],
        };
        for (let i = this.options.current_year - 5; i < this.options.current_year + 1; i++) {
            this.default_data.labels.push(i);
            this.default_data.datasets[0].values.push(0);
        }

        this.default_invoice_table_data = {
            columns: [
                { name: 'Date', editable: false},
                { name: 'Num', width: 150, editable: false},
                { name: 'Amount', editable: false},
                { name: 'Open Balance(CAD)', editable: false}],
            data: [['-', '-', '-', '-']],
            layout: 'fluid'
        };
        
        // Set up formatter
        this.formatter = new Intl.NumberFormat('en-US', {
            style: 'currency',
            currency: 'USD',
        });

        // Set defaults and bind on change
        me.elements.trend_period.on("change", function() {
            me.options.trend_period = $(this).val();
            me.get_ie_trend(me);
        });

        me.elements.expense_breakdown_period.on("change", function() {
            me.options.expense_breakdown_period = $(this).val();
            console.log(me.options.expense_breakdown_period);
            me.get_expense_breakdown(me);
        });

        me.elements.top_customer_period.on("change", function() {
            me.options.top_customer_period = $(this).val();
            me.get_top_customer_by_sales(me);
        });

        me.elements.prev_year_income_period.on("change", function() {
            me.options.prev_year_income_period = $(this).val();
            me.get_prev_year_income_comparison(me);
        });

        me.elements.prev_year_expense_period.on("change", function() {
            me.options.prev_year_expense_period = $(this).val();
            me.get_prev_year_expense_comparison(me);
        });
        
        // Bind refresh button
        this.elements.refresh_btn.on("click", function() {
            me.get_data();
        });

        // Initialize Tables and Charts
        setTimeout(function () {me.get_data()}, 0);
    }

    get_data() {
        this.get_ie_trend(this);
        this.get_top_customer_by_sales(this);
        this.get_prev_year_income_comparison(this);
        this.get_prev_year_expense_comparison(this);
        this.get_owing_customers(this);
        this.get_expense_breakdown(this);
    }

    get_expense_breakdown(me) {
        let expense_breakdown_chart = this.render_loading("expense-breakdown-chart");
        let filters = this.build_expense_breakdown_filter(me);
        // Get the whole profit and loss statement report
        frappe.call({
            method: "frappe.desk.query_report.run",
            args: {
                filters: filters,
                report_name: "Profit and Loss Statement",
            },
            callback: function(r) {
                expense_breakdown_chart.removeAttribute("style");
                console.log(r.message);
                let total_expense = r.message.result.find(it => it.account == "Expenses - CIP");
                let cogs_expense = r.message.result.find(it => it.account == "Cost of Goods Sold - CIP");
                let operating_expense = r.message.result.find(it => it.account == "Operating Expenses - CIP");
                let other_expense = r.message.result.find(it => it.account == "Other Expenses - CIP");

                let expense_breakdown_data = {
                    labels: ["COGS", "Operating", "Other"],
                    datasets: [
                        {
                            name: "Expense",
                            chartType: "pie",
                            values: [cogs_expense.total, operating_expense.total, other_expense.total]
                        }
                    ],
                }
                me.render_chart(expense_breakdown_data, "pie", ["#ff1f1f", "#F8BE8A", "#F48928"], "#expense-breakdown-chart");
            }
        });
    }

    render_loading(element) {
        let AR_chart = document.getElementById(element)
        AR_chart.innerHTML = "Loading...";
        AR_chart.style.textAlign = "center";
        AR_chart.style.margin = "auto";

        return AR_chart;
    }

    build_expense_breakdown_filter(me) {
        let filters = {
            company:"XXXX",
            filter_based_on:"XXXX",
            period_start_date:"XXXX",
            period_end_date:"XXXX",
            from_fiscal_year:"XXXX",
            to_fiscal_year:"XXXX",
            periodicity:"XXXX",
            cost_center:[],
            project:[],
            include_default_book_entries:1
        };
        if (me.options.expense_breakdown_period == "this_year") {
            filters.from_fiscal_year = me.options.current_year;
            filters.to_fiscal_year = me.options.current_year;
            filters.period_start_date = String(me.options.current_year) + filters.period_start_date.slice(4);
            filters.period_end_date = String(me.options.current_year) + filters.period_end_date.slice(4);
        }
        else if (me.options.expense_breakdown_period == "last_year") {
            filters.from_fiscal_year = me.options.current_year - 1;
            filters.to_fiscal_year = me.options.current_year - 1;
            filters.period_start_date = String(me.options.current_year - 1) + filters.period_start_date.slice(4);
            filters.period_end_date = String(me.options.current_year - 1) + filters.period_end_date.slice(4);
        }

        return filters;
    }

    get_ie_trend(me) {
        frappe.call({
            method: "erpnext.accounts.page.company_snapshot.company_snapshot.get_income_expense_trend",
            args: {
                trend_period: this.options.trend_period
            },
            callback: function(r) {
                me.render_chart(r.message, "bar", me.options.colors, "#ie-trends-chart");
            }
        });
    }

    get_top_customer_by_sales(me) {
        frappe.call({
            method: "erpnext.accounts.page.company_snapshot.company_snapshot.get_top_customers_by_sales",
            args: {
                period: this.options.top_customer_period
            },
            callback: function(r) {
                // console.log(r.message);
                me.render_chart(r.message, "bar", me.options.colors, "#top-customers-chart");
            }
        });
    }

    get_prev_year_income_comparison(me) {
        frappe.call({
            method: "erpnext.accounts.page.company_snapshot.company_snapshot.get_prev_year_income_comparison",
            args: {
                period: this.options.prev_year_income_period
            },
            callback: function(r) {
                me.render_chart(r.message, "bar", me.options.colors, "#prev-year-income-chart");
            }
        });
    }

    get_prev_year_expense_comparison(me) {
        frappe.call({
            method: "erpnext.accounts.page.company_snapshot.company_snapshot.get_prev_year_expense_comparison",
            args: {
                period: this.options.prev_year_expense_period
            },
            callback: function(r) {
                me.render_chart(r.message, "bar", me.options.colors, "#prev-year-expense-chart");
            }
        });
    }

    get_owing_customers(me) {
        frappe.call({
            method: "erpnext.accounts.page.company_snapshot.company_snapshot.get_owing_customers",
            callback: function(r) {
                // console.log(r.message);
                let owing_customer_table_data = {
                    columns: [
                        { name: 'Customer', editable: false},
                        { name: 'Due Date', width: 140, editable: false},
                        { name: 'Amount Due (CAD)', editable: false}],
                    data: r.message,
                    layout: 'fluid'
                };

                for (let i = 0; i < owing_customer_table_data.data.length; i++) {
                    owing_customer_table_data.data[i][2] = me.formatter.format(owing_customer_table_data.data[i][2]);
                }
                
                me.render_table(owing_customer_table_data, "#customer-owing-table");
            }
        });
    }

    // Render table based on the data
    render_table(data, element) {
        let table = new frappe.DataTable(element, {
            columns: data.columns,
            data: data.data
        })
    }

    // Render chart based on the data
    render_chart(data, type, colors, element) {
        let chart = new frappe.Chart( element, { // or DOM element
            data: data,
            // title: title,
            type: type, // or 'bar', 'line', 'pie', 'percentage'
            height: 300,
            colors: colors,
            // ['green', "#ff1f1f", "orange"]
            tooltipOptions: {
                // formatTooltipX: d => (d + '').toUpperCase(),
                formatTooltipY: d => this.formatter.format(d),
            },
            barOptions: {
                spaceRatio: 0.7 // default: 1
            },
            axisOptions: {
                // xIsSeries: 1
                shortenYAxisNumbers: 1
            }
        });
        setTimeout(function () {chart.draw(!0)}, 1);
    }

    is_table_name(element, name) {
        while (element.parentElement) {
            element = element.parentElement;
            if (element.id == name) {
                return true;
            }
        }
        return false;
    }
};

I tried adding async await, setting different timeout in different spots based on a few suggestions online. Since I thought it was a timing issue, it thought it could be that the DOM is not loaded fully before I tried to create the charts and tables using the framework. But the problem still persists.

i can’t pass props to child component when requerying from server

I request asynchronous data from the server and pass it through props to the child component, while registering it in a reactive variable. When I request the data again, I overwrite the reactive variable I pass to the child component, but the data doesn’t change and nothing happens.
I use Nuxt3 last version

Index.vue:

<script setup> 
import { API_KEY, BASE_URL } from "@/constants/index";

const city = ref("Paris");
const weatherInfo = ref(null);

const getWeatherData = async () => {
  const { data } = await useFetch(
    `${BASE_URL}?q=${city.value}&appid=${API_KEY}`
  );
  weatherInfo.value = data;
};
<script>

<template>
<input
  @keyup.enter="getWeatherData"
  v-model="city"
  type="text"
  class="search"
/>
                  
<TheWeatherSummary :weatherInfo="weatherInfo" />
</template>

When I re-request data from the server, it is not updated in the child component

<script setup>
const props = defineProps({
  weatherInfo: {
    type: [Object, null],
    required: true,
  },
});

</script>

<template>
{{ weatherInfo }}
</template>

Please tell me what am I doing wrong?