nativescript-snackbar icon indicating copy to clipboard operation
nativescript-snackbar copied to clipboard

Snackbar is hidden by iOS keyboard. So using it for validation is tricky.

Open firescript opened this issue 9 years ago • 18 comments
trafficstars

If we could set a position property, to maybe say bottom, or top. That would be useful. Just in cases where developers are using it to handle validation alerts.

firescript avatar Jan 22 '16 15:01 firescript

I don't have much iOS knowledge so I'm not sure how we could handle this. Especially since we are using a cocoapod for the iOS version.

@sitefinitysteve - do you know of a way to handle this scenario?

bradmartin avatar Jan 22 '16 15:01 bradmartin

I asked here as well: https://github.com/stonesam92/SSSnackbar/issues/6

firescript avatar Jan 22 '16 15:01 firescript

@bradmartin Howbdies android handle the scenario... Or does it

sitefinitysteve avatar Jan 22 '16 15:01 sitefinitysteve

It doesn't from what I recall. I will check later.

On Fri, Jan 22, 2016, 9:33 AM Steve McNiven-Scott [email protected] wrote:

@bradmartin https://github.com/bradmartin Howbdies android handle the scenario... Or does it

— Reply to this email directly or view it on GitHub https://github.com/bradmartin/nativescript-snackbar/issues/5#issuecomment-173952346 .

bradmartin avatar Jan 22 '16 15:01 bradmartin

It's not really the purpose of a Snackbar to use for validation. On a form you would use it for informing the user the form didn't submit successfully. With the option to resubmit. So the keyboard typically isn't open, but on android I believe the default works well with the keyboard being open. So if the cocoapod could just handle the keyboard the same, that would be good.

On Fri, Jan 22, 2016, 9:35 AM Brad Martin [email protected] wrote:

It doesn't from what I recall. I will check later.

On Fri, Jan 22, 2016, 9:33 AM Steve McNiven-Scott < [email protected]> wrote:

@bradmartin https://github.com/bradmartin Howbdies android handle the scenario... Or does it

— Reply to this email directly or view it on GitHub https://github.com/bradmartin/nativescript-snackbar/issues/5#issuecomment-173952346 .

bradmartin avatar Jan 22 '16 15:01 bradmartin

On android does it just slide up above the keyboard?

firescript avatar Jan 22 '16 15:01 firescript

I just put in a PR that has support for show and showTop methods now. show() uses the bottom default way, and showTop() renders it at the top of the view.

https://github.com/stonesam92/SSSnackbar/pull/7

firescript avatar Jan 22 '16 20:01 firescript

Great work.

On Fri, Jan 22, 2016, 2:01 PM Ryan Lebel [email protected] wrote:

I just put in a PR that has support for show and showTop methods now. show() uses the bottom default way, and showTop() renders it at the top of the view.

stonesam92/SSSnackbar#7 https://github.com/stonesam92/SSSnackbar/pull/7

— Reply to this email directly or view it on GitHub https://github.com/bradmartin/nativescript-snackbar/issues/5#issuecomment-174029800 .

bradmartin avatar Jan 22 '16 20:01 bradmartin

I think for this {N} plugin we should keep the "show" but pass in an optional position parameter... since it has to work on both platforms, internally android could just ignore.

sitefinitysteve avatar Jan 24 '16 17:01 sitefinitysteve

Sounds good. Once they update the cocoapod, can one of you guys handle the update? I don't have a Mac to do test with (I know, I know... very sad).

On Sun, Jan 24, 2016, 11:44 AM Steve McNiven-Scott [email protected] wrote:

I think for this {N} plugin we should keep the "show" but pass in an optional position parameter... since it has to work on both platforms, internally android could just ignore.

— Reply to this email directly or view it on GitHub https://github.com/bradmartin/nativescript-snackbar/issues/5#issuecomment-174323085 .

bradmartin avatar Jan 24 '16 17:01 bradmartin

yepyep

sitefinitysteve avatar Jan 24 '16 17:01 sitefinitysteve

Although looks like android has a variant too? http://stackoverflow.com/questions/30585550/how-do-i-change-an-android-snackbars-initial-alignment-from-bottom-to-top

sitefinitysteve avatar Jan 24 '16 20:01 sitefinitysteve

Yea I don't care to implement this, as it goes against the material design spec on what a Snackbar is. If you guys want to do it then that's fine as long as its an optional feature. It's just not an issue on android, if the cocoapod managed the layout according to the spec then putting it at the top wouldn't be an issue.

At any rate if you guys want it and have the time to implement it then thats great, I don't have the time right now and this isn't something I'm in favor or. However I respect you guys and if you want/need it then that gains my attention to make the plugin better :)

On Sun, Jan 24, 2016, 2:16 PM Steve McNiven-Scott [email protected] wrote:

Although looks like android has a variant too? http://stackoverflow.com/questions/30585550/how-do-i-change-an-android-snackbars-initial-alignment-from-bottom-to-top

— Reply to this email directly or view it on GitHub https://github.com/bradmartin/nativescript-snackbar/issues/5#issuecomment-174336811 .

bradmartin avatar Jan 24 '16 20:01 bradmartin

Any update on the iOS stuff?

bradmartin avatar Feb 24 '16 04:02 bradmartin

Nope, looks like that pod is just orphaned atm :/ Leave this issue open though if you could

sitefinitysteve avatar Feb 24 '16 15:02 sitefinitysteve

I think we can use this line of code to dismiss the keyboard without worrying about which view is the first responder.

In Swift UIApplication.sharedApplication().sendAction("resignFirstResponder", to:nil, from:nil, forEvent:nil)

In Objective-C [[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];

Obsessive avatar May 19 '16 14:05 Obsessive

So before showing snackbar we can hide the keyboard

Obsessive avatar May 19 '16 14:05 Obsessive

If one of the other iOS guys want to test and confirm this approach let's add it :)

On Thu, May 19, 2016, 9:50 AM Obsessive Inc [email protected] wrote:

So before showing snackbar we can hide the keyboard

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/bradmartin/nativescript-snackbar/issues/5#issuecomment-220348175

bradmartin avatar May 19 '16 15:05 bradmartin