« first day (2658 days earlier)      last day (2515 days later) » 

09:03
How to clear a state of an obj in React. I wanna clear the this.state.definition to be empty, but I dont know how.
09:34
morning
@MarceloRafael this.setState({defnition: undefined})
or empty string, as you want
Morning
@Neoares Yeah, I have put this.setState(definition: null); but doesn't work, I'll walk the dog and make a video to explain the issue.
you missed curly brackets
setState expects an object to be passed
@masud_moni your dev branch has already those edits if you did git merge cleaned-android in your dev branch
> Today while I was trying to merge cleaned-android into developmen
use gitk if you are still unsure
09:54
hello friends
what kind of weird european shenanigans are we up to tonight
Are there any performance advantages to using Promises over callbacks?
@Ryan Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
@Ryan don't use callbacks unless you have to
but no, not that I'm aware of
Why?
because they suck
09:56
haha. cant argue there
they have pretty much been deprecated
if you can say that
if I see a callback in code I'm working on I wrinkle my nose
that should be reason enough
le doge wrinkles nose
haha okay i see. thanks @Mosho
@Mosho a local animal care center is looking for a "professional cat cudler"
@Mosho I'm not your friend, buddy
10:01
keh, just dl'ed thumbdrive edition of git download
Well gee, thanks for the follow-up. Now I look like a douche
the release notes html file did not got updated
@Neil I'm not your buddy, guy
@Neil as you should
😐
promises are using callbacks btw ...
* hides *
10:02
@BenFortune I'm not your guy, pal
I'm not your pal, comrade
I'm not your comrade, cyka blyat
it is raining cash somewhere in USA
UPDATE: Today's accident near Mahomet spilled cash on the interstate, via @ngphotostaff's @stephenhaas. http://bit.ly/2n6qn8X. #NGMedia
"you missed curly brackets
setState expects an object to be passed" @Neoares I had put curly braces in my code, but not here
Thank
10:19
and it works?
then show your code
wait a moment
hey guys
i have a scope problem
go for a 6x if the target is between 200-400m
10:34
is there a way to make an input element clickable when it's inside a button, in firefox? It works in chrome
5/5 help seeker thoroughly confused
maybe you can disable click event?
I want the button to be clickable too
but only when you're not clicking the input
I'm hoping there's a CSS solution to this
disable button click event when clicked on input
you have to use JS
10:35
that's what I'm trying to figure out. I might not
@towc goes against the standard ...
well, actually, it's ok if the button goes off when you click the input
@towc hey, stop trolling, you have to use JS
@KarelG yeah, it's not a fantastic idea, huh :/
use JS and then come back here
10:37
test
Error: test is undefined
I am surprised that Chrome even put an input in that
but UX wise ... seems weird, that what you want to achieve
I guess I can just use divs and a tabindex to keep it accessible, although urgh
I thought I'd never see the day that would happen, but found this in the source code of an open source thing I'm contributing to
QUESTION: How to make onclick correspond to specific ID
PROBLEM:
```
var hashedID = [];
array.forEach((e, i) => {
hashedID[i] = data[i].id
$(prospectCardDate).attr('onclick', 'console.log('+ hashedID[i] +')');
```

ERROR:
```
GaYovv1z is not defined
at HTMLElement.onclick
```

Problem lies within that ```i``` variable. If I leave it with like that:
```
hashedID = data[i].id
$(prospectCardDate).attr('onclick', 'console.log('+ hashedID +')');
```
it works like a charm, but only on the last iterated element.
I hope i explained it well. I just don't get it why i doesn't work inside jquery function
Because single-letter variable names are almost as horrible as using jQuery
10:43
that's what jumps to your eyes?
> almost
the evaled string looks so much worse
oh i know
uhhh, true that
i just tried some different approac
10:44
why did you mention it @FlorianMargaine
it hurts
It looks bad but it's not the case
I'm pretty sure it's not
so what's your goal?
why it doesn't work if in console it throws an error with this specific ID? XD
$(prospectCardDate)
also what is that
doesn't matter
10:46
GaYovv1z
what is that
Instead of logging
> GaYovv1z

it throws an error
>GaYovv1z is not defined at HTMLElement.onclick
GaYovv1z is hashed variable
but it's working for the previous elements in the array?
@topher Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
document.querySelector(prospectCardDate).addEventListener('click', () => {console.log(hashedID[i])});
It doesn't work for the previous. It does work if i remove this 'i' variable but then it only works for the last element - obvious
10:49
if it only works for the last element you probably have the instruction outside the loop
@Kac
I'd say to provide us a MCVE
in jsfiddle or codesandbox
@Neoares thanks! :) It works now.
I tried a little bit different approach with both querySelector and addEventListener but it didnt work
!!help examplepls
@Neoares examplepls: User-taught command: Could you please give us an example on http://jsbin.com or http://jsfiddle.net, with the minimal amount of code necessary to reproduce the problem?
10:51
!!examplepls KacperCieluch
@Neoares Could you please give us an example on jsbin.com or jsfiddle.net, with the minimal amount of code necessary to reproduce the problem?
#fail
the help is not useful
youtube.com/watch?v=JwfZqomlPsk wtf, would they think that I'm an idiot?
Almost the same solution as yours
10:56
1 message moved to Trash can
@KacperCieluch Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
@Neoares Rep+ I tried this approach before jsfiddle.net/4or5kncq/4 but I just put wrong id inside selector
So I think this might be good solution to having clean AJAX calls , so you can reuse them wherever you want witch whichever callbacks, jsfiddle.net/kdgrrre7/3
@KarelG Why on the Switch?
@KacperCieluch that's why I asked you wtf $(prospectCardDate) was
Ugh, setting up replication is a PITA when you have 1tb of data
11:02
what do you call an element that is outlined because it was tabbed (the key) into?
it's not focused, is it?
outlined
I thought it was. Hmmm
Yeah, haha. I will try to be more observant in the future :) Thanks
11:03
lol a textarea with id input
maybe it's the only input in the page?
guess again!
thas not id
@BenFortune like, the only actual and important input (?)
it's THE input
well, my designer added a rule for all "a" elements
11:29
a rule?
si
a {
  /* some styles */
}
and this is problematic?
stop using the word "problematic"
one a to rule them all and in the darkness bind them
@GNi33 yes?
how am I supposed to create a link now without that rule applied
11:36
maybe you're not supposed to
sure
so a designer will tell me if I'm supposed or not xD
this really isn't uncommon
uhm, yeah
I mean, when I realized I wasn't even modifying the page
I was doing a plugin for it
so I needed different styles
.plugin a {
    // override the changes back to default
}
that's dirty AF
11:39
if the rest of the site needs to have links in a certain color or something, that's perfectly fine
why not just ".container a" for the web page
oh because that would make all the difference?
I generally avoid rules like a { ... } because it applies by default
@Neil with extremely low specifity
@Neil I enjoyed this more than I should have.
11:40
it's not about specificity, it's about the need of overriding all the properties to default
usually, you don't even need to do that
for some reason I don't like it
usually, you want your links styled a certain way across the page by default
get more specific based on that
as I said, .pageContainer a {} looks nice to me
if there's an a { position: absolute}, sure, you got a big problem there
11:42
@Neoares I happen to agree with this
but that's not how these things are done usually
It is simple to change
a {
color: #15bece;
text-decoration: none;
-webkit-transition: all .25s ease-out;
-moz-transition: all .25s ease-out;
-ms-transition: all .25s ease-out;
-o-transition: all .25s ease-out;
transition: all .25s ease-out;
cursor: pointer;
}
@Neoares but how does it make a difference?
that's what I got
11:42
> cursor: pointer;
haha
maybe it's about the person writing the css not being an asshole and adding a bunch of weird stylings by default
how many things in your page are going to be outside of the container?
many
idk xD
the help system that I'm doing now, for example
and how many of those things do not need the default styling of the page?
many, also
11:44
yay, spent 2 hours debugging why an API was returning false, no matter of data
but actually this generic a style did something nice
reason: somewhere != instead of ==
I don't mind "clean slate" default stylings
when we moved all dialogs to react's 16 portals, the style was still being applied
because portals are defined outside the containers, so that was nice
!! afk lunch. I am fucking hangry
11:45
but nothing that might create problems with other stylings
@KarelG hope you added a test
@KarelG lunch at 2-3 like we do in spain lul
@Neoares yeah, this is why you usually do stuff like that
but still T_T
to get a default styling of basic things across the whole page
11:46
it's fine if you don't put shitty styles inside
or unnecessary
the style being so low specifity, that it's impossible to fall beyond it when overwriting
@Neoares well, of course
@KarelG it could have been worse: !!! instead of !!
@tereško KarelG is afk: lunch. I am fucking hangry
12:27
hey guys! How can I put the label left to the input?
<div class="col-md-6">
       <label for="username" class="label label-primary">Nombre de usuario</label>
                <input id="username" type="text" class="form-control" name="username" value="{{ old('username') }}" required autofocus>
</div>
.label-primary { float: left; }
#username {float: left;}
so, I have to change bootstrap file?
or can I put inline there?
I bet you have the link of the bootstrap like so:
<link href="...bootstrap">
no
I have the bootstrap file
but how are you using the bootstrap ?
12:33
.wife {
    right: 100%;
    margin: 0;
}
<link href="{{ asset('css/bootstrap.css') }}" rel="stylesheet">
ok quico
in css folder I have bootstrap file
You could have a custom.css file that you load after bootstrap where you put all of your custom styles for you site that will override the bootstrap ones, but that's up to you. Otherwise you should be able to do it in line but that's not considered good practice by most.
@QuicoLlinaresLlorens look up .form-horizontal in the bootstrap docs
12:34
now you need to put <link href="...you custom css here">
below of the bootstrap
depends on what bootstrap version you're using, but here: getbootstrap.com/docs/3.3/css/#forms-horizontal
Oh ok, You would'nt want change your bootstrap
stuff like that comes with bootstrap out of the box
is there a chat about meta concernes?
12:37
yeah, forms come out of the box with bootstrap code.divshot.com/geo-bootstrap/#forms
@GNi33 actually I have the form-horizontal
then check your markup and compare it to the examples in the bootstrap docs
Someone that understand about react js could help me with my problem ?
I think it doesnt work with primary label
Ok, now is working but...
@Neoares that is 1-2 for me ... your country is just not on the clock!
12:52
I really have to get better at git
@KarelG I know
blame Franco
what's the right way to do the following: contribute to a public repo by a single user while solving 2 different issues in 2 different pull requests, through github
you create 2 branchs
1 for each issue
and push each one separately
what I'm doing now is making a fork, cloning, doing some changes for the first issue, creating a pull request, then doing some changes for the second issue, but it ends up in the first pull request
@Neoares oh, local branches that get merged to the master branch of the other user?
that actually makes a lot of sense
you do not have to create two branches lol
does not make sense in view of the master
12:55
why not
they're 2 different issues
one branch per issue
I always create a branch for each issue
@KarelG what do you do
just ensure that the changes made to fix an issue is being committed as one issue
12:56
@KarelG well, maybe the person wants to only accept my solution to one of the issues
clone 2 times
@Neoares that seems even less elegant
I like the branches solution
neither you are
That's the most common workflow iirc

« first day (2658 days earlier)      last day (2515 days later) »