Bug 954712 - [Messages] Hide subject field when input is empty and user taps backspace #15118
Conversation
subject.dispatchEvent(new CustomEvent('blur')); | ||
subject.dispatchEvent(new CustomEvent('focus')); | ||
assert.isFalse(banner.classList.contains('hide')); | ||
suite('Visibility', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tests from here to the end
event.preventDefault(); | ||
|
||
Compose.toggleSubject(); | ||
ThreadUI.updateSubjectHeight(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use here this.updateSubjectHeight
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
s***. Any better idea ? Do we have a keyup for each keydown even if the user moves the finger out of the screen ? |
@julienw I've fixed this on desktop, but there is definitely a bug in the keyboard app: it fires a keydown, keypress and keyup event even when holding. |
I've pushed the WIP so you can load it on your device. Load it up and then run (assuming you're at new message with a subject field open)
|
sorry, I couldn't have a look today, keeping this for tomorrow morning! |
backspace = function(id) { | ||
ThreadUI.onSubjectKeydown(event); | ||
ThreadUI.onSubjectKeyup(event); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can create event
and backspace
out of the setup
This needs a rebase |
this needs jshint/gjslint lint fixes too :) |
Right, this wasn't "ready" for review yet either—which is why it's filled with console.log, I put those there so you could see the issue I was running into. :P |
Yeah but I wanted to r+ it already ;) (and it is, so you can actually merge whenever you want!) |
…er taps backspace https://bugzilla.mozilla.org/show_bug.cgi?id=954712 Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Hi sorry for posting off topic, wrong section, wrong site etc.. I'm mucking around with ffos(1.2) simulator and having trouble with keypress firing with the return key, works in ff on mac as expected. $(".null").keypress(function(e) {
var inputText = $(this).val().trim();
if(e.which == 13 && inputText) {
var chunks = inputText.match(/.{1,1024}/g)
, len = chunks.length;
for(var i = 0; i<len; i++) {
socket.emit('null', {
msg: chunks[i]
});
}
$(this).val('');
return false;
}
}); This should work shouldn't it? |
@rwxes I think you're better off asking this on a Q&A site: http://stackoverflow.com/questions/tagged/jquery |
@rwaldron thanks. |
This pull request has been closed due to tree stability issues. Please rebase and re-open the pull request if you still need to land this. Ensure the gaia-try run is green before landing. Sorry for any inconvenience. |
https://bugzilla.mozilla.org/show_bug.cgi?id=954712
Signed-off-by: Rick Waldron waldron.rick@gmail.com