Skip to content

Using choices.js causes an error in the console #4308

Open
@RichardWGNR

Description

@RichardWGNR

Problem

Found that when using the choices.js library and clicking on one of the <select> options, the following error pops up in the console:

00:26:45 [windows] 2025-06-21T19:26:45.580891Z ERROR ThreadId(01) dioxus_desktop::webview: Error parsing user_event: Error("invalid type: null, expected usize", line: 1, column: 250).Contents: Ok(""), raw: Request {
00:26:45 [windows]     method: POST,                                                                                           
00:26:45 [windows]     uri: dioxus://index.html/__events,    
00:26:45 [windows]     version: HTTP/1.1,
00:26:45 [windows]     headers: {
00:26:45 [windows]         "accept": "*/*",
00:26:45 [windows]         "content-type": "application/json",
00:26:45 [windows]         "origin": "http://dioxus.index.html",
00:26:45 [windows]         "referer": "http://dioxus.index.html/",
00:26:45 [windows]         "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0",
00:26:45 [windows]         "dioxus-data": "eyJuYW1lIjoibW91c2Vkb3duIiwiZGF0YSI6eyJhbHRfa2V5IjpmYWxzZSwiYnV0dG9uIjowLCJidXR0b25zIjoxLCJjbGllbnRfeCI6NTQ5LCJjbGllbnRfeSI6NDcwLCJjdHJsX2tleSI6ZmFsc2UsIm1ldGFfa2V5IjpmYWxzZSwib2Zmc2V0X3giOjU0OSwib2Zmc2V0X3kiOjQ3MCwicGFnZV94Ijo1NDksInBhZ2VfeSI6NDcwLCJzY3JlZW5feCI6NzY1LCJzY3JlZW5feSI6Njc5LCJzaGlmdF9rZXkiOmZhbHNlfSwiZWxlbWVudCI6bnVsbCwiYnViYmxlcyI6dHJ1ZX0=",
00:26:45 [windows]     },
00:26:45 [windows]     body: [],
00:26:45 [windows] }

Steps To Reproduce

Steps to reproduce the behavior:

  • Include choices.js on the page and create a <select> to be managed by it.
use_effect(move || {
    eval(r#"
const element = document.getElementById("ic-procedures-select");
const choices = new Choices(element);
    "#);
});

rsx! {
    select {
        id: "ic-procedures-select",
        option { value: "extended_session", "Запросить диагностическую сессию" },
        option { value: "default_session", "Запросить обычную сессию" },
        option { value: "hard_reset", "Перезагрузка блока (hard reset)" },
        option { value: "odo", "Чтение пробега" },
    }
}
  • Buld the application and click to any select's option

Expected behavior

No messages in console

Environment:

  • Dioxus version: 0.7.0-alpha.0 and 0.7.0-alpha.1
  • Rust version: 1.87.0-stable
  • OS info: Windows 11
  • App platform: Desktop

Questionnaire

I'm interested in fixing this myself but don't know where to start.

I don't have time to fix this right now, but maybe later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions