Why does inner HTML content appear instantly after css max-height transition completes?

Using HTML and JavaScript I am trying to create a list that transitions into view when a button is clicked, including a scrollable inner container, using a max-height transition on the parent DIV.

However, while the parent div transitions smoothly, the content instantly appears after the transition completes. It seems to occur when the inner div is overflowing.

Here is an example of what I have been attempting.

let visible = false;

function showHideList() {
  const listContainerRef = document.getElementById('list-id');
  if (!listContainerRef?.style?.maxHeight) 
    return;
    
  listContainerRef.style.maxHeight = visible ? 0 + 'px' : 200 + 'px';
  visible = !visible;
}
<button onclick="showHideList()" style="padding: 1rem; background: #2aabd2">Show / Hide</button>
<div id="list-id" style="transition: max-height 2s linear; overflow: hidden; max-height: 0;">
  <div style="overflow: auto; max-height: 200px">
    <div style="background-color: green">
      <span style="display: block; background-color: red; padding: 0.5rem 0.75rem">Item 1</span>
      <span style="display: block; background-color: red; padding: 0.5rem 0.75rem">Item 2</span>
      <span style="display: block; background-color: red; padding: 0.5rem 0.75rem">Item 3</span>
      <span style="display: block; background-color: red; padding: 0.5rem 0.75rem">Item 4</span>
      <span style="display: block; background-color: red; padding: 0.5rem 0.75rem">Item 5</span>
      <span style="display: block; background-color: red; padding: 0.5rem 0.75rem">Item 6</span>
    </div>
  </div>
</div>

How do I scrape data in element with python

I am trying to get the data behind a canvas element on a javscript-based website. I am new to this, so far I have only scraped information using Selenium from basic html websites.

The website where that I want to scrape is behind a login page so I will just copy the code and the js files that are loaded.

I am not asking directly for a solution but more like a direction of where to go and what to study to be able to do this myself using Python.

I opened each single js file and I can’t figure out where the data comes from.

Any help will be highly appreciated.
Here’s the source code, inside the link you can also see and access the different js.

view-source:https://report.talents-unlimited.com/en/talents

How to simulate click properly on “Show more workflows …” buton on GitHub?

I’m trying to use Tempermonkey user script on Firefox to click “Show more workflows…” in Github repositories like this one. But somehow using this code

// ==UserScript==
// @name         GH show all workflows
// @namespace    http://tampermonkey.net/
// @version      2024-10-28
// @description  try to take over the world!
// @author       You
// @match        https://github.com/*/*/actions
// @match        https://github.com/*/*/actions/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    setTimeout(function () {
        console.log('DEBUG1');
        document.querySelector('div.ActionListItem')?.click();
        console.log('DEBUG2');
    }, 2000);
})();

somehow generates this error and do not show remaining workflows

Uncaught (in promise) TypeError: t.target.closest(...) is null
    showMore nav_list_group_element.js:74
    l bind.js:73
    window["__f__m2u8mn6l.cv"]/</< GH-show-all-workflows.user.js:21
    setTimeout handler*window["__f__m2u8mn6l.cv"]/</< GH-show-all-workflows.user.js:16
    window["__f__m2u8mn6l.cv"]/< GH-show-all-workflows.user.js:24
    Pt actions:10
    window["__f__m2u8mn6l.cv"]/< GH-show-all-workflows.user.js:1
    "__f__m2u8mn6l.cv" GH-show-all-workflows.user.js:1
    Pt actions:10
    r actions:85
    <anonymous> actions:88
    _ actions:22
nav_list_group_element.js:74:32
    showMore nav_list_group_element.js:74
    InterpretGeneratorResume self-hosted:1420
    AsyncFunctionNext self-hosted:807
    (Async: async)
    l bind.js:73
    window["__f__m2u8mn6l.cv"]/</< GH-show-all-workflows.user.js:21
    (Async: setTimeout handler)
    window["__f__m2u8mn6l.cv"]/</< GH-show-all-workflows.user.js:16
    window["__f__m2u8mn6l.cv"]/< GH-show-all-workflows.user.js:24
    Pt actions:10
    window["__f__m2u8mn6l.cv"]/< GH-show-all-workflows.user.js:1
    "__f__m2u8mn6l.cv" GH-show-all-workflows.user.js:1
    Pt actions:10
    r actions:85
    <anonymous> actions:88
    _ actions:22
    Pt content.js:9
    h content.js:64
    d content.js:67
    send content.js:67
    Tn content.js:16
    send content.js:67
    y content.js:62
    is content.js:63
    fo content.js:22
    (Async: setTimeout handler)
    fo content.js:22
    n content.js:2
    Tn content.js:16
    n content.js:1
    fo content.js:22
    is content.js:63
    n content.js:62
    InterpretGeneratorResume self-hosted:1420
    next self-hosted:1341
    Pt content.js:9
    t content.js:10
    e content.js:1
    i content.js:1
    n content.js:1
    n content.js:1
    Pt content.js:9
    t content.js:1
    rs content.js:62
    forEach self-hosted:160
    Pt content.js:9
    t content.js:10
    rs content.js:58
    Ms content.js:77
    ys content.js:77
    Tn content.js:16
    forEach self-hosted:160
    Pt content.js:9
    t content.js:10
    Tn content.js:16
    o content.js:72

Clicking with mouse on same div works without issues. How can I properly simulate click event so it will work same way as normal mouse click?

Thanks.

Delay in Initial Launch of Electron Applications

Why do applications created with Electron experience a significant delay in their initial launch, taking between 5 to 10 seconds to start, but launch quickly on subsequent runs? This delay happens again if Windows is restarted, with the first launch taking longer each time. Even Electron’s own “quick start” app behaves this way after being built, but VS Code, also built with Electron, doesn’t have this delay. What’s the reason for this?
also i tested with empty app and just html file without any script

Trigger text selection UI in iOS Safari when selecting text programmatically

In iOS Safari, I’m able to select text programmatically using the following code. However, the text selection UI (selection handles and blue overlay) don’t show, unless the user has already manually selected something on the page.

Everything works as expected in other browsers I’ve tested (Android Chrome, macOS Chrome, macOS Safari, and macOS Firefox) – it’s only failing in iOS/iPadOS Safari.

I’ve tried various event listeners to trigger the text selection: onclick, pointerdown, pointerup, touchstart, touchend, etc. – but no luck.

Does anyone know of a workaround or have any ideas?

const paragraphs = document.querySelectorAll('p');
for (paragraph of paragraphs) {
  paragraph.addEventListener('click', selectParagraphContents);
}

function selectParagraphContents(event) {
  const selection = window.getSelection();
  const range = document.createRange();
  range.selectNodeContents(event.currentTarget);
  selection.removeAllRanges();
  selection.addRange(range);
}

// Log selection changes to the console for debugging
document.addEventListener('selectionchange', (event) => {
  const selection = window.getSelection();
  console.log(selection.type + ': "' + selection.toString() + '"');
});
<p>Tap to select this paragraph.</p>
<p>Or this paragraph.</p>

Syncfusion asp.net grid didn’t show data

I am developing a small application in Syncfusion ASP.NET Core using the Grid control. My goal is to display data in the grid using the following setup:

<ejs-grid id="SourcingGrid" dataSource="@Url.Action("GetSourcingData", "Home")" allowPaging="true" toolbar="@(new List<string> { "Add", "Edit", "Delete", "Update", "Cancel" })">
    <e-grid-editSettings allowAdding="true" allowEditing="true" allowDeleting="true"></e-grid-editSettings>
    <e-grid-columns>
        <e-grid-column field="Sourcing_Fullname" headerText="Full Name" width="150" textAlign="Left"></e-grid-column>
        <e-grid-column field="Sourcing_Address" headerText="Address" width="150" textAlign="Left"></e-grid-column>
        <e-grid-column field="Sourcing_Mobile_no" headerText="Mobile No" width="120" textAlign="Left"></e-grid-column>
        <e-grid-column field="Sourcing_Email" headerText="Email" width="150" textAlign="Left"></e-grid-column>
        <e-grid-column field="Status" headerText="Status" width="80" textAlign="Center" type="boolean"></e-grid-column>
        <e-grid-column field="Blacklisted" headerText="Blacklisted" width="100" textAlign="Center" type="boolean"></e-grid-column>
        <e-grid-column field="Remarks" headerText="Remarks" width="150" textAlign="Left"></e-grid-column>
    </e-grid-columns>
</ejs-grid>

In my controller, I have the following action method:

public IActionResult GetSourcingData()
{
    var sourcingData = _sourcingDAL.GetAllSourcingAsync();
    return Json(sourcingData);
}

And in my data access layer, I have this asynchronous method:

public async Task<IEnumerable<Sourcing>> GetAllSourcingAsync()
{
    var sourcings = new List<Sourcing>();
    using (var connectionManager = new DatabaseConnectionManager(_connectionString))
    {
        using (var con = connectionManager.GetConnection())
        {
            using (var cmd = new SqlCommand("SP_SOURCING_DETAIL", con))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@PROC", SqlDbType.Int).Value = 0;

                // Open connection if it's not already open
                if (con.State != ConnectionState.Open)
                {
                    await con.OpenAsync();
                }

                using var rdr = await cmd.ExecuteReaderAsync();
                while (await rdr.ReadAsync())
                {
                    sourcings.Add(new Sourcing
                    {
                        Sourcing_Id = Convert.ToInt32(rdr["Sourcing_Id"]),
                        Sourcing_Fullname = rdr["Sourcing_Fullname"].ToString(),
                        Sourcing_Address = rdr["Sourcing_Address"].ToString(),
                        Sourcing_Mobile_no = rdr["Sourcing_Mobile_no"].ToString(),
                        Sourcing_Contact_no = rdr["Sourcing_Contact_no"].ToString(),
                        Sourcing_Email = rdr["Sourcing_Email"].ToString(),
                        Status = rdr["Status"] != DBNull.Value && Convert.ToBoolean(rdr["Status"]),
                        Remarks = rdr["Remarks"] != DBNull.Value ? rdr["Remarks"].ToString() : string.Empty,
                        Blacklisted = rdr["Blacklisted"] != DBNull.Value && Convert.ToBoolean(rdr["Blacklisted"])
                    });
                }
            }
        }
    }
    return sourcings;
}

However, when I run the project, neither the data nor the grid is displayed.

Issues Encountered:

  1. When inspecting requests in Developer Tools, I see an error message:

    Uncaught SyntaxError: Invalid regular expression flags

    This points to a problem with the following line:

    "dataSource": /Home/GetSourcingData,

Could anyone help me identify the issue and suggest possible fixes? Thank you!

What I’ve Tried:

  • Checked the URL in the browser to ensure it resolves correctly.

  • Verified that the GetSourcingData method is being called (it isn’t).

  • Made sure all necessary libraries for Syncfusion and ASP.NET Core are included.

I expected the following:

  • When the page loads, the GetSourcingData method should be invoked, retrieving the data from the database.

  • The data should be returned as JSON, which the Syncfusion Grid would then use to populate the grid with rows displaying the sourced data.

  • The grid should render correctly on the page, allowing for interaction (like paging, editing, and deleting).

React Error : Invalid hook call. Hooks can only be called inside of the body of a function component

I am at the beginning phase of my react learning. Right now, trying to create an application. Getting the above error. Below is the code

Tile.js

import React from 'react';
import styles from './Tile.module.css';

// Tile.js
const Tile = ({ text, onClick }) => {
  return (
    <div className={styles.tile} onClick={onClick}>
      {text}
    </div>
  );
};


export default Tile;

Onboarding.js

// Onboarding.js
import React from 'react';
import styles from './Onboarding.module.css';

const Onboarding = () => {
  // const questionsLeft = new Array(6).fill(null);
  // const questionsRight = new Array(6).fill(null);

  return (
  <>
  </>
  );
};

export default Onboarding;

LandingPage.js

// Landing.js
import React from 'react';
import { useNavigate } from 'react-router-dom';
import Tile from '../Tile/Tile.js';
import styles from '../Tile/Tile.module.css';
import TileTextArray from '../Constants/constants.js';

const Landing = () => {
  const navigate = useNavigate();

  // const handleTileClick = () => {
  //   navigate('/onboarding');
  // };

  return (
    <div className={styles.tileContainer}>
      <Tile text={TileTextArray.Tile1Text} onClick={() => navigate('/onboarding')} />
      <Tile text={TileTextArray.Tile2Text} />
      <Tile text={TileTextArray.Tile3Text} />
      <Tile text={TileTextArray.Tile4Text} />
    </div>
  );
};

export default Landing;

App.js

// App.js
       import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
       import Landing from './Landing/LandingPage';
       import Onboarding from './Onboarding/Onboarding';
       import './App.css';
       
       function App() {
         return (
           <Router>
             <Routes>
               <Route path="/" element={<Landing />} />
               <Route path="/onboarding" element={<Onboarding />} />
             </Routes>
           </Router>
         );
       }
       
       export default App;

I don’t have any duplicate react version, and After executing npm ls react I got the below

├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
└── [email protected]

I couldn’t figure out why this is failing. Requesting help!

Capacitor SQLite Web: Error: Run: ExecSet: in saveToStore SetDBToStore: undefined

I am currently facing a problem with the Capacitor Community Sqlite Library with Angular Ionic, on desktop web (Chrome used as browser).

@capacitor-community/sqlite

https://www.npmjs.com/package/@capacitor-community/sqlite

The difficult thing is that the error only occurs roughly 1% of the time (1 in 100 times). It’s really hard to reproduce. It might be some sort of race condition triggering in my app.

I sometimes get this error after I refresh my page in the browser:

Error: Run: ExecSet: in saveToStore SetDBToStore: undefined

Error image

so this basically happens whenever I initialize my database with the plugin, whenever I open it

After that error, subsequent calls to my database fail with the same error:

Error: Run: ExecSet: in saveToStore SetDBToStore: undefined

Error: Query: <database-name> database not opened

So far I only noticed this bug on the web but for sure it’s possible that it happens on native too since I am looking into the console less there and I am also not refreshing the page there at all, compared to when developing on the web.

So my quetion basically is, what the cause of this error could be, that undefined is returned.

It has sth to do with the jeepSqliteElement I think, since when looking at the source of SetDBToStore:

static async setDBToStore(mDb, dbName, store) {
    try {
        // export the database
        const data = mDb.export();
        // store the database
        await UtilsStore.saveDBToStore(dbName, data, store);
        return Promise.resolve();
    }
    catch (err) {
        return Promise.reject(`SetDBToStore: ${err.message}`);
    }
}

I am calling the saveToStore method on the web too, mentioned here:

https://github.com/capacitor-community/sqlite/issues/545

I know this might seem like neglible but the app completely breaks for the user every 1/100 refreshes, which might also prevent users from staying on the page in the first place.

Unable to programatically element.focus() a textarea/input in .net maui blazor

I am having problem trying to auto focus a textarea/input tag using .NET MAUI Blazor when a page is loaded. Happens only on Android but iOS is working fine. And it does not showing any error at all. Just nothing happen.

here are my codes:

<input type="text" @ref="myref" />
<script>
    window.exampleJsFunctions =
    {
        focusElement: function (element) {
            element.focus();
        }
    };
</script>
private ElementReference myref;

protected override async Task OnAfterRenderAsync(bool firstRender)
{
    if (firstRender)
    {
        await JSRuntime.InvokeVoidAsync("exampleJsFunctions.focusElement", myref);
    }
}

Expo build successfully but does not load anything that is being fetched from firestore. And also crashes when navigating

My react native application works perfectly fine on Expo Go so I thought it would be a successful build. After the apk build finished, the data that is loaded on expo go does not load on the apk and there are no logs (I dont know where it is). this is my current package.json, please tell me what else is needed. Thank you

{
  "name": "appname",
  "version": "1.0.0",
  "main": "expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo/vector-icons": "^14.0.2",
    "@google/generative-ai": "^0.12.0",
    "@gorhom/bottom-sheet": "^4.6.3",
    "@react-native-async-storage/async-storage": "^1.23.1",
    "@react-native-community/datetimepicker": "^7.6.1",
    "@react-native-community/netinfo": "11.3.1",
    "@react-native-picker/picker": "2.7.5",
    "@react-native-segmented-control/segmented-control": "2.5.2",
    "@react-navigation/bottom-tabs": "^6.6.1",
    "@react-navigation/material-top-tabs": "^6.6.13",
    "@react-navigation/native": "^6.1.17",
    "@react-navigation/native-stack": "^6.9.26",
    "@rneui/base": "^4.0.0-rc.7",
    "@rneui/themed": "^4.0.0-rc.8",
    "@shopify/flash-list": "1.6.4",
    "@stream-io/flat-list-mvcp": "^0.10.3",
    "dompurify": "^3.1.7",
    "expo": "~51.0.8",
    "expo-av": "~14.0.6",
    "expo-camera": "~15.0.10",
    "expo-checkbox": "~3.0.0",
    "expo-clipboard": "~6.0.3",
    "expo-file-system": "~17.0.1",
    "expo-image": "~1.13.0",
    "expo-image-manipulator": "~12.0.5",
    "expo-image-picker": "~15.0.5",
    "expo-linear-gradient": "~13.0.2",
    "expo-location": "~17.0.1",
    "expo-media-library": "~16.0.3",
    "expo-sharing": "~12.0.1",
    "expo-splash-screen": "~0.27.4",
    "expo-status-bar": "~1.12.1",
    "expo-video": "^1.2.3",
    "expo-web-browser": "~13.0.3",
    "firebase": "^10.12.0",
    "lottie-react-native": "6.7.0",
    "marked": "^14.1.2",
    "moment": "^2.30.1",
    "react": "18.2.0",
    "react-hook-form": "^7.53.1",
    "react-native": "0.74.1",
    "react-native-awesome-gallery": "^0.4.0",
    "react-native-date-picker": "^5.0.7",
    "react-native-dropdown-picker": "^5.4.6",
    "react-native-element-dropdown": "^2.12.2",
    "react-native-emoji-modal": "^0.2.4",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-gifted-chat": "^2.4.0",
    "react-native-image-viewing": "^0.2.2",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-maps": "1.14.0",
    "react-native-markdown-display": "^7.0.2",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^17.1.0",
    "react-native-pager-view": "^6.3.0",
    "react-native-paper": "^5.12.5",
    "react-native-paper-tabs": "^0.10.4",
    "react-native-picker-select": "^9.3.1",
    "react-native-pinchable": "^0.2.1",
    "react-native-ratings": "^8.1.0",
    "react-native-reanimated": "~3.10.1",
    "react-native-reanimated-carousel": "^3.5.1",
    "react-native-reanimated-viewer": "^1.4.1",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "react-native-svg": "15.2.0",
    "react-native-tab-view": "^3.5.2",
    "react-native-toast-message": "^2.2.0",
    "react-native-uuid": "^2.0.2",
    "react-native-video": "^6.4.1",
    "stream-chat-expo": "^5.32.1",
    "toastify-react-native": "^5.0.2",
    "validator": "^13.11.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}

and this is my eas.json

{
  "cli": {
    "version": ">= 12.6.1",
    "appVersionSource": "remote"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "production": {
      "autoIncrement": true
    }
  },
  "submit": {
    "production": {}
  }
}

I have tried rebuilding it, clearing previous builds but still no progress.

React State Handling

made a caching method in my react notepad and came up to a minor bug, I used useEffect to set an interval of 3 seconds then updates the cache holder if the heading and description is not false although when it starts to run and either of the heading or description changes back to false(empty or invalid value) the interval doesn’t recognised the updates

when it starts to run it does not stops back then even though the heading or description has emptied which has to set the interval condition to false

let [heading, setHeading] = useState(addTextCache.heading)
let [description, setDescription] = useState(addTextCache.description)
useEffect(() => {
    let count = 0
    setInterval(() => {
        if(heading != false && description != false) {
            count++
            console.log(count)
            console.log(heading != false && description != false)
            setAddTextCache({
                heading: heading,
                description: description
            })
      }
    }, 3000)
}, [heading, description])

Vite drop console.log but keep console.error on esbuild

I want to remove the console.logs in the build but don’t want to remove the console.errors, is there a way to do this?

This is what I currently have.

    esbuild: {
      drop: mode === 'production' ? ['console', 'debugger'] : undefined
    },

This is also drops the console.errors.

Do I need to create a plugin or a rollup?

Getting Uncaught TypeError: Cannot read properties of null (reading ‘value’)

When trying to console log a variable I declared inside of my event function, my console is shooting back this error

Uncaught TypeError: Cannot read properties of null (reading 'value')
    at HTMLButtonElement.wuTangForever (main.js:16:76)

I tried to make a form, with radio inputs and attributes.

<p>Pepsi or Coke?</p>
<input type="radio" id = "pepsi" name = "soda" value = "1">
<label for = "">Pepsi</label>
<input type="radio" id = "coke" name = "soda" value = "2">
<label for = "">Coke</label>

In my JavaScript, I have the following code:

const sodas = Number(document.querySelector('input[name = soda]:checked').value)

when I console.log(sodas), or do anything, the message error appears. I checked my script tag as I saw others were having the same issue. That did not resolve the issue.

What I want to do is get the value of the checked radio input, turn that value into a number to put into an array.

Stabilizing Tests Against Variable Server Response Times

Errors vary from test to test. I believe this is due to different server response times. We are currently including “timeout” and “waitfor” in our code to counter this. Please let us know if there are any other measures to stabilize server speed other than the above.

I believe this is due to different server response times. We are currently including “timeout” and “waitfor” in our code to counter this.

How to Receive SMS in Node.js/Express from ESP32 with SIM800L?

I’m working on a project where I need to receive SMS messages sent from an ESP32 device equipped with a SIM800L module. The SIM800L is using a personal SIM card with its own number.

I’m currently using Node.js with Express.js for my backend. Can anyone help me? I’m looking for a way to receive these SMS messages directly without relying on another esp32, third-party apps, or services like Twilio or any other services.

THANKSS IN ADVANCE!!

I tried using third-party apps, but I don’t want to rely on them because it creates extra hassle for users to use those apps before they can receive sms on my application.