question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can set event onkeydown to table?

See original GitHub issue

Now I using the code as below but it is not working

    Dictionary<string, object> OnRow(RowData<T> row)
    {
        Action<KeyboardEventArgs> onPress = arg =>
        {
            // todo 
        };
        return new Dictionary<string, object> { { "onkeydown", onPress } };
     }

I can add onkeydown to table?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anranruyecommented, May 28, 2021
    Dictionary<string, object> OnRow(RowData<Data> row) => new()
    {
        ["onkeydown"] = (Action<KeyboardEventArgs>)((e) => Console.WriteLine($"row {row.Data.Key} key pressed {e.Code}")),
        ["tabIndex"] = "0"
    };

now the onkeydown event is triggered

0reactions
sannv0012commented, May 28, 2021

Thank @anranruye

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I trigger an onkeydown event on html table ...
You need to set tabindex property (eg tabindex="1" ) to some value, so it can identify that this table is keyboard selectable.
Read more >
onkeydown Event
The onkeydown event occurs when the user presses a key on the keyboard. Keyboard Events. Event, Occurs When. onkeydown, The user presses a...
Read more >
Element: keydown event - Web APIs | MDN
The keydown and keyup events provide a code indicating which key is pressed, while keypress indicates which character was entered. For example, ...
Read more >
Control.OnKeyDown(KeyEventArgs) Method
Raises the KeyDown event. ... e: KeyEventArgs. A KeyEventArgs that contains the event data. ... Set the flag to true and evaluate in...
Read more >
Control.KeyDown Event (System.Windows.Forms)
Set the flag to true and evaluate in KeyPress event. ... This event occurs after the KeyDown event and can be used to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found