Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 30 15:37
    dependabot[bot] labeled #97
  • Mar 30 15:37
    dependabot[bot] opened #97
  • Mar 30 15:37

    dependabot[bot] on npm_and_yarn

    Bump y18n from 4.0.0 to 4.0.1 … (compare)

  • Feb 14 11:25
    codechips closed #96
  • Feb 14 11:25
    codechips commented #96
  • Feb 14 10:49
    ArthurClemens labeled #96
  • Feb 14 10:49
    ArthurClemens commented #96
  • Feb 14 10:14
    codechips opened #96
  • Feb 01 21:44
    ArthurClemens commented #95
  • Feb 01 21:42
    ArthurClemens closed #95
  • Feb 01 21:42

    ArthurClemens on master

    Prevent caching of tab state F… Bump to 1.7.5 (compare)

  • Feb 01 21:07
    ArthurClemens opened #95
  • Feb 01 21:03

    ArthurClemens on next

    Update changes.md Bump lodash from 4.17.15 to 4.1… Merge pull request #92 from Art… and 3 more (compare)

  • Dec 10 2020 23:56

    ArthurClemens on npm_and_yarn

    (compare)

  • Dec 10 2020 23:56

    ArthurClemens on master

    Bump ini from 1.3.5 to 1.3.7 B… Merge pull request #94 from Art… (compare)

  • Dec 10 2020 23:56
    ArthurClemens closed #94
  • Dec 10 2020 23:53
    dependabot[bot] labeled #94
  • Dec 10 2020 23:53
    dependabot[bot] opened #94
  • Dec 10 2020 23:53

    dependabot[bot] on npm_and_yarn

    Bump ini from 1.3.5 to 1.3.7 B… (compare)

  • Sep 11 2020 14:32

    ArthurClemens on npm_and_yarn

    (compare)

Carlo Guglielmin
@cgug
I can reboot to Windows and try there if that helps. Seems pretty consistent so I don't think the OS matters
Arthur Clemens
@ArthurClemens
I am using Mac OS with Chromium. I don’t see it happen on any field in the kitchensink: https://arthurclemens.github.io/polythene-demos/mithril/#/textfield
Carlo Guglielmin
@cgug
I tested there as well and couldn't reproduce it earlier. But do those have oninput linked up as well as value? Because if I remove the oninput event or switch it to onchange the problem is fixed
Arthur Clemens
@ArthurClemens
No, some use TextField prop onChange
Carlo Guglielmin
@cgug
Yeah, works fine with onchange, but not oninput
Arthur Clemens
@ArthurClemens
onChange (with capital C) is not the HTML function onchange
Carlo Guglielmin
@cgug
Do any of them have value? Because without that the issue is also fixed
Just tested, still jumps with onChange
Arthur Clemens
@ArthurClemens
Could you create a reproducable case using this flems as base?
Carlo Guglielmin
@cgug
Sure, just adding value to the TextField does it, here it is
Arthur Clemens
@ArthurClemens
Why do you need value?
Because value sets the input value
Carlo Guglielmin
@cgug
In some cases because we're loading a saved record from mongo and need to set it to the field initially
Arthur Clemens
@ArthurClemens
In that case you need defaultValue
Carlo Guglielmin
@cgug
Do you see the caret jump I was talking about in that flems?
Arthur Clemens
@ArthurClemens
I do see it with value, not with defaultValue
Carlo Guglielmin
@cgug
Okay, I'll use defaultValue where necessary, as I agree that fixes it. Thanks!
Arthur Clemens
@ArthurClemens
The documentation of value says: "Input value; this should normally not be set - for instance Safari will move the input to the end of the string at each change"
You basically get conflicting inputs (controlled and non controlled input)
Carlo Guglielmin
@cgug
Yeah my mistake for using value that way
defaultValue doesn't update the field if the service call takes a while to return, even with a redraw, so I might go with the onchange instead (lowercase intentional) since that wasn't jumping, and will just fire on blur instead of input
Arthur Clemens
@ArthurClemens
Correct, defaultValue is the initial value
Carlo Guglielmin
@cgug
Which unfortunately makes it the wrong fit for loading from a db where the property has an existing value beforfehand, but since value has the caret issue, seems like onchange is the workaround
Arthur Clemens
@ArthurClemens
You can also use callback function setInputState using the state object
Carlo Guglielmin
@cgug
Hmm yeah
Probably not worth the clunkiness of having to maintain setInputState for 10+ fields on a complex page
I guess I was hoping TextField could be a drop-in replacement for an HTML input, since there you can set value and oninput without any caret jumping
Arthur Clemens
@ArthurClemens
Carlo Guglielmin
@cgug
Wrapping TextField might be a good alternative, thanks for that example
Arthur Clemens
@ArthurClemens
Instead of using the callback, you could use a more Mithril-like way by storing the dom node once it is available and set the value of the input element
Arthur Clemens
@ArthurClemens
But this only works nicely when there is no initial value, otherwise the field gets visibly re-initialized.
Arthur Clemens
@ArthurClemens
Carlo Guglielmin
@cgug
Any awesome ideas for determining if a page/form is "dirty" and has unsaved changes?
Arthur Clemens
@ArthurClemens
The tests contain an example with Powerform. You can see the result at the bottom of https://arthurclemens.github.io/polythene-demos/mithril/#/textfield
Carlo Guglielmin
@cgug
Back with another one. Thoughts on adding a default keypress/keydown/keyup/keysomething listener on the Button component to "click" it when Spacebar is pressed? Basically like a traditional HTML button. Helps a tiny bit for accessibility too.
Arthur Clemens
@ArthurClemens
Yes that makes sense
Carlo Guglielmin
@cgug
Wow quiet here...
Feature request: could keyboard support be added to some components, such as Tabs and Menu?
Arthur Clemens
@arthurclemens:matrix.org
[m]
The kitchen sink contains a couple of examples of keyboard control: List "Keyboard control" and Search "Search results". This could be generalized.
What's the behavior you're looking for?
Carlo Guglielmin
@cgug
Tabs was the one I was thinking of - if the tabs have focus keyboard left/right moves between them, space/enter selects the tab, that kind of thing
Arthur Clemens
@arthurclemens:matrix.org
[m]
How does the tab get initial focus?
I guess with tabIndex
That way nothing special needs to be build to capture focus
Fox menus it's more tricky, because you need to set the focus to the first item in the list once it is opened
Arthur Clemens
@arthurclemens:matrix.org
[m]
If you go to https://arthurclemens.github.io/polythene-demos/mithril/#/tabs you'll see that using TAB you can move focus from tab to tab
and use ENTER to select it