workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
that operator is from older versions
2019-05-13T06:37:58.423400
Virgie
elmlang
general
it was removed quite a while ago, I think you can replace it with `field` , so `"keyname" := decoder` becomes `field "keyname" decoder`
2019-05-13T06:38:54.424600
Virgie
elmlang
general
thanks <@Virgie>
2019-05-13T06:39:01.424700
John
elmlang
general
how would you go about implementing preloading images of a view? like, i have a view consisting of a couple of images and i want to display a loader until all images are ready. my first idea would be to base64 encode them and request them via the http package, but maybe there’s a simpler way?
2019-05-13T11:22:57.427800
Daryl
elmlang
general
Any suggestions on post-build i18n libs? Seems like everything I've seen is pre-build setup.
2019-05-13T11:29:06.428600
Elliott
elmlang
general
May help: <https://package.elm-lang.org/packages/krisajenkins/remotedata/latest/RemoteData>
2019-05-13T11:41:44.428700
Iona
elmlang
general
<http://blog.jenkster.com/2016/06/how-elm-slays-a-ui-antipattern.html>
2019-05-13T11:41:52.428900
Iona
elmlang
general
I think christophp/elm-i18n is post-build, but I could be mistaking what the difference between pre and post build i18n is <@Elliott>
2019-05-13T12:34:18.430300
Ashton
elmlang
general
(Is pre-build where the translations are built into the code, and post build where the code loads up translations from data?)
2019-05-13T12:34:53.430900
Ashton
elmlang
general
i’m already using this, maybe to reframe the question: is there a way to track the loading process of images when they are loaded via an image tag, or do i have to manually load them via an http request to get that kind of info
2019-05-13T12:46:27.431000
Daryl
elmlang
general
Not yet AFAIK - although there are some changes coming wrt lazy loading of images that the browser itself will support at the tag level
2019-05-13T13:01:27.431200
Iona
elmlang
general
I wrote an Elm app recently that displays a table of data. A user can filter the table, sort it, etc. It works great. I have a new requirement to make sure that the header of the table is always visible. As the user scrolls the page, the header will move up the page. Once the header hits the top of the page, it will be...
2019-05-13T14:13:04.435000
Marcus
elmlang
general
using `position: sticky` will not work?
2019-05-13T14:16:35.435100
Allison
elmlang
general
This sort of behavior is usually done via CSS, not Elm/JS :slightly_smiling_face:
2019-05-13T14:19:35.435600
Carman
elmlang
general
Yeah, actually, `position: sticky` might so the trick. I'd avoided it in the past due to browser support, but looks like the browsers might have caught up.
2019-05-13T14:20:30.435800
Marcus
elmlang
general
<@Carman> Yea, I was expecting to have to swap a class when the element hit the top of the window, for instance to swap to between `position: relative` and `position: fixed`, or something.
2019-05-13T14:21:35.436000
Marcus
elmlang
general
So, mostly CSS, but with a little JS/Elm in there to apply the correct class.
2019-05-13T14:21:55.436200
Marcus
elmlang
general
it should be ok to use, it’s actually part of bootstrap css
2019-05-13T14:24:28.436400
Allison
elmlang
general
From a member of our team: 1. in order to structurally separate table headers from the content rows, you need to use `table-layout: fixed` mode (<https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout>) 2. your model needs to be in charge of turning `position: sticky` on and off for the table header section 3. ...
2019-05-13T14:25:06.436600
Simon
elmlang
general
Thanks <@Rosaria>. That's awesome information. It sounds like there is a bit of JS/Elm tomfoolery in there to adjust the classes based on scroll position, unless I'm misreading it.
2019-05-13T14:28:06.436900
Marcus
elmlang
general
Yes- we have a fairly robust table control we may be open sourcing at some point - we’ve been dealing with sticky headers, config, filter/sort/URL interactions, expandable rows, etc - happy to give a quick tour sometime
2019-05-13T14:29:57.437100
Simon
elmlang
general
Thanks. Might be good to swap notes. Sounds like you might be farther along than me, but I implemented a bunch of those features in my app too.
2019-05-13T14:30:50.437300
Marcus
elmlang
general
Seems like everyone doing any sort of business app is gonna hit at some point :slightly_smiling_face:
2019-05-13T14:31:06.437500
Simon
elmlang
general
LOL. Yup. Anything with a non-trivial table.
2019-05-13T14:31:27.437700
Marcus
elmlang
general
Also, go bean-town Elm’ers :wink:
2019-05-13T14:32:08.437900
Simon
elmlang
general
even though I’m in the former bean town camp
2019-05-13T14:32:16.438100
Simon
elmlang
general
Once a Bostonian, always a Bostonian.
2019-05-13T14:40:32.438500
Marcus
elmlang
general
Is there an alternatve to --- toString function for 0.19 ? I need to convert some lists to String to display on the page and sometimes I need to do that for a record. The old toString could do that.
2019-05-13T15:12:03.440100
Lory
elmlang
general
Is this to show to users or just for debugging purposes?
2019-05-13T15:13:05.440700
Carman
elmlang
general
You need to write the function yourself if you want to do this in production
2019-05-13T15:13:18.441400
Danika
elmlang
general
for testing, for experimentation
2019-05-13T15:13:41.441900
Lory
elmlang
general
Debug.toString exists
2019-05-13T15:14:30.442500
Danika
elmlang
general
Thanks, I will try that.
2019-05-13T15:14:49.443100
Lory
elmlang
general
you can do it with JS but not with pure Elm
2019-05-13T18:01:48.443700
Nana
elmlang
general
or actually it's possible you could... :thinking_face:
2019-05-13T18:03:04.443900
Nana
elmlang
general
yep! <https://ellie-app.com/5xgqn6L76jya1>
2019-05-13T18:12:04.446400
Nana
elmlang
general
``` img [ src "<https://placekitten.com/1000/1000>" , on "load" (Decode.succeed Loaded) ] [] ```
2019-05-13T18:13:21.446600
Nana
elmlang
general
is there a way to dump information from `Explore History` via a command in the console? I have some rspec specs that are failing, and I’d like to know the state of the model at a certain time, hopefully with something like a `@page.execute_script("Elm.Main.dump");`
2019-05-13T18:38:33.447100
Su
elmlang
general
I can do this in chrome console ``` $('div:contains("Explore History")').click() ``` but cannot view within rspec/capybara because I think it is opening in a new window
2019-05-13T18:44:35.447400
Su
elmlang
general
why would I see _I cannot find a `Set` constructor:_, even if my file contains `import Set exposing (..)`?
2019-05-14T01:04:14.448400
Son
elmlang
general
oh; I'm trying to use a type at the term level
2019-05-14T01:05:31.448800
Son
elmlang
general
Anyone knows how to prevent default inside an `onKeyDown` subscription. An example would be great. The docs don't have anything on this: <https://package.elm-lang.org/packages/elm/browser/latest/Browser-Events#onKeyDown>
2019-05-14T01:12:01.450700
Maxwell
elmlang
general
Sorry, didn’t have time to try out your API. Do still plan on working on it if something quite similar exists? If yes I’ll try out your API tonight. If no, maybe you’d be interested in modifying your code to work with elm/bytes instead? That seems like a library no one has written yet (and that I have use for)
2019-05-14T03:32:41.451300
Jae
elmlang
general
Yes, because the alternatives are not as complete. Using elm/bytes too could be interesting, actually :thinking_face:
2019-05-14T03:39:43.451500
Raylene
elmlang
general
The `onKeyDown` subscription doesn't support preventDefault. The workaround is to decode the event on the "outermost" element.
2019-05-14T03:44:03.451700
Millie
elmlang
general
<https://package.elm-lang.org/packages/Gizra/elm-keyboard-event/latest/>
2019-05-14T03:44:06.451900
Millie
elmlang
general
Cool, I'll try out your API tonight then
2019-05-14T03:44:08.452100
Jae
elmlang
general
<https://gizra.github.io/elm-keyboard-event/OutermostDiv.html>
2019-05-14T03:44:20.452300
Millie
elmlang
general
<https://github.com/andys8/vim-emulation/blob/91da6521dc9d59858485f9209c79329630ba3470/src/View.elm#L15>
2019-05-14T03:45:22.452500
Millie
elmlang
general
Has anyone had problems with &lt;textarea&gt; in Edge? For me, every time I type a character, the cursor jumps to the start and if I backspace away all the characters, I get this error. I don't have these problems in Chrome or Firefox
2019-05-14T04:06:38.453900
Jae
elmlang
general
It looks like the problem goes away if I assign the text using Html.Attributes.value instead of placing Html.text inside the body of the text area
2019-05-14T04:21:06.454200
Jae
elmlang
general
Yeah, you can’t really set the value of a `textarea` dom node by adding a child-element. Chrome and FF ignore it, Edge errors. `value` is the proper solution :thumbsup:
2019-05-14T04:27:43.454400
Huong
elmlang
general
Hi there. I posted on the beginners group last week but no one could help me. Is there anyone that could please help me with a few issues in my elm app? I am new to elm but the only available dev for this project so if someone with experience can help that would be great. I will pay for your help
2019-05-14T04:49:27.457300
Hunter
elmlang
general
Alright, good to know. This seems to be what elm-ui does for Input.multiline so I've posted a question about it in <#C4F9NBLR1|elm-ui>
2019-05-14T04:54:52.457600
Jae
elmlang
general
Could you post a link to your message in the beginner channel?
2019-05-14T04:55:38.458000
Lynne
elmlang
general
<https://elmlang.slack.com/archives/C192T0Q1E/p1557408090276800>
2019-05-14T04:56:17.458200
Hunter
elmlang
general
Sorry for long waiting time. Personally, I don’t have any experience with that library and hence cannot answer why it behaves like it does. Also, the example you pointed to was not updated to 0.19 version and it may be misleading for you.
2019-05-14T05:16:00.458500
Lynne
elmlang
general
The library itself was but it is not possible to run the example and check what’s going on in there.
2019-05-14T05:16:47.458700
Lynne
elmlang
general
Okay. Is there a 0.19 drop down library that you know works?
2019-05-14T05:17:06.458900
Hunter
elmlang
general
You could help answering you if you created an Ellie app (<https://ellie-app.com/new>) demoing your problem
2019-05-14T05:17:23.459100
Lynne
elmlang
general
I have never used any drop-down library. It is usually easier to do it with regular `Html` module
2019-05-14T05:17:52.459300
Lynne
elmlang
general
Especially if you are beginner, that is a recommended way
2019-05-14T05:18:01.459500
Lynne
elmlang
general
Thanks so much. Is there an example of the html that you can perhaps point me to?
2019-05-14T05:19:19.459700
Hunter
elmlang
general
Emm, I could probably craft something quickly
2019-05-14T05:20:02.459900
Lynne
elmlang
general
wow thanks so much
2019-05-14T05:23:02.460200
Hunter
elmlang
general
<https://ellie-app.com/5xtCS3fZYHPa1>
2019-05-14T05:25:51.460400
Lynne
elmlang
general
Quite an ugly example but demonstrates the purpose :slightly_smiling_face:
2019-05-14T05:26:01.460600
Lynne
elmlang
general
:100:
2019-05-14T05:26:38.460800
Hunter
elmlang
general
If I was writing a real component I would not repeat myself so much but to show how it works it is ok :slightly_smiling_face:
2019-05-14T05:26:50.461000
Lynne
elmlang
general
thanks that makes so much more sense
2019-05-14T05:26:50.461200
Hunter
elmlang
general
<@Millie> Thanks. I could use `onKeyDown` with an input element. Do you know how to prevent default at all? The documentation doesn't have full examples, so I can't piece it together myself.
2019-05-14T05:59:15.461400
Maxwell
elmlang
general
<#C0CJ3SBBM|general>
2019-05-14T06:06:09.461900
Maxwell
elmlang
general
From <https://github.com/andys8/vim-emulation/blob/91da6521dc9d59858485f9209c79329630ba3470/src/View.elm#L15> I'm trying to understand the following code. ``` onKeyDown : Html.Attribute Msg onKeyDown = Decode.field "key" Decode.string |&gt; Decode.map (\key -&gt; ( KeyDown key, True )) |&gt; preve...
2019-05-14T06:06:40.462600
Maxwell
elmlang
general
``` onKeyDown = Decode.field "key" Decode.string |&gt; Decode.map (\key -&gt; ( KeyDown key, key == "x" )) |&gt; preventDefaultOn "keydown" ```
2019-05-14T06:07:31.463100
Maxwell
elmlang
general
Would that work? Also, what is `KeyDown key`?
2019-05-14T06:08:20.463800
Maxwell
elmlang
general
KeyDown is a `Msg`: <https://github.com/andys8/vim-emulation/blob/91da6521dc9d59858485f9209c79329630ba3470/src/Model.elm#L47>
2019-05-14T06:10:51.464600
Danika
elmlang
general
I see.
2019-05-14T06:11:33.465200
Maxwell
elmlang
general
Your`key == “x”` seems like it should work, yes
2019-05-14T06:12:11.465500
Danika
elmlang
general
Is that Elm 0.19?
2019-05-14T06:17:48.466000
Maxwell
elmlang
general
I can't find the docs for `Decode.field`. And I don't know if that's 0.18 or 0.19.
2019-05-14T06:18:48.466800
Maxwell
elmlang
general
Basically, I can't understand the whole expression.
2019-05-14T06:19:11.467100
Maxwell
elmlang
general
By the way, I was also looking at the `Html.events` docs searching for an `onKeyDown` to see how a regular keydown event works, but it seems like there is none?
2019-05-14T06:22:24.471300
Maxwell
elmlang
general
<https://package.elm-lang.org/packages/elm/html/latest/Html-Events#preventDefaultOn> <https://package.elm-lang.org/packages/elm/json/latest/Json-Decode#field> `preventDefaultOn` needs the name of the event, and a decoder that decodes the event object into `(msg, Bool)`, where the Bool is whether or not to prevent def...
2019-05-14T06:22:25.471400
Danika
elmlang
general
re: no default onKeyDown &gt; Note: It looks like the spec is moving away from event.keyCode and towards event.key. Once this is supported in more browsers, we may add helpers here for onKeyUp, onKeyDown, onKeyPress, etc.
2019-05-14T06:23:23.472000
Danika
elmlang
general
Hmm, gotcha.
2019-05-14T06:23:50.472700
Maxwell
elmlang
general
Thanks! :handshake:
2019-05-14T06:24:00.473000
Maxwell
elmlang
general
I see some decoders only produce a `Msg`, like: ``` onClick : msg -&gt; Attribute msg onClick message = on "click" (Decode.succeed message) ```
2019-05-14T06:26:30.476100
Maxwell
elmlang
general
Can you help me identify "Msg" there?
2019-05-14T06:26:52.476700
Maxwell
elmlang
general
`message`?
2019-05-14T06:27:06.476900
Maxwell
elmlang
general
Are you familiar with the elm architecture, and using `Msg`s in general?
2019-05-14T06:27:34.478100
Danika
elmlang
general
So, that would be the message I process in my `update` function, correct?
2019-05-14T06:27:35.478200
Maxwell
elmlang
general
<@Maxwell> that means that they don't give any value
2019-05-14T06:28:13.479600
Nana
elmlang
general
ie. `onInput` gives you a string, but onClick is just an event without extra info
2019-05-14T06:29:03.482100
Nana
elmlang
general
In this case, the onClick is a function that takes any message and gives back a `Attribute msg` whenever that element is clicked. Its intentionally generic because how can anyone know about *your* `Msg` type. you might do: ``` type Msg = ButtonClicked | ... — somewhere in view button [ onClick ButtonClicked ] ...
2019-05-14T06:31:44.485600
Danika
elmlang
general
Thank you, again. :+1:
2019-05-14T06:33:21.486100
Maxwell
elmlang
general
No problem (:
2019-05-14T06:40:07.486700
Danika
elmlang
general
Elm 0.19 do not support |&gt; Http.send msg style Http.send command?
2019-05-14T06:42:21.488700
Majorie
elmlang
general
No
2019-05-14T06:44:05.489300
Danika
elmlang
general
By the way, the original example I posted was using `preventDefaultOn`, but if I want also `stopPropagation`, can I use `custom` like this? I'm mostly trying to nail down the syntax. ``` onKeyDown = Decode.field "key" Decode.string |&gt; Decode.map (\key -&gt; { message = KeyDow...
2019-05-14T06:44:20.489600
Maxwell
elmlang
general
`True` not `true` but yes that should work
2019-05-14T06:45:55.490900
Danika