native.newtextfield and tableview

Hi all, 

   I placed a native.newtextfield in a a tableview widget and placed that widget below my UI header.   When I scroll my tableview up my textfield rolls right over my UI.  For example: 

I would expect that the tableview would set things inside of it to invisible when the scroll bounds are reached.  Maybe I am missing something.  Probably not returning true somewhere I should be :)   

For grins I moved the tableview down to the middle of the device and when scrolling up it did eventually hide the textfield.  But way later than it should have.  So it is doing something.  But I am not sure what.  

Thanks, L

Without any code this is going to be extremely hard to deduce. I would suggest doing the minimal possible example that will produce the problem and post it here. 

That makes sense.  I was just trying to get a quick gauge of the expected behavior from my post.   

I have never tried it inside a table view, but I have tried it inside an overlay and it does move with the overlay as long as it is in the same group. I can’t imagine why it wouldn’t work from a table view.

It moves just fine.  It just sits on top and doesn’t get turned invisible until it is way off the screen.   I just tried to track its whereabouts so that I could manually turn if off before it hits the UI element but since it is part of a row container the y value never changes.  Maybe there is something else I can check other than object.y.   I will keep digging. 

This looks interesting:   https://docs.coronalabs.com/api/type/DisplayObject/localToContent.html

OK,  This seems to allow me to track it even tho it is inside the row display group.  

local bounds = M.NickNameField.contentBounds 

        print (“M.NickNameField.y”,bounds.yMin)

So I can track it myself and make it go invisible before it hits the UI element.  However, I think this should happen automatically so I don’t have to do this myself :(   

More custom code I have to write inside the tableViewListener.   Not fun.  

native.* objects are not part of the Corona OpenGL canvas. The widget.* objects are built as part of the OpenGL canvas. The two don’t interact. In theory we added support to move native.* objects when the group they are fake-added to move, but in general, but other display.* actions like layering them, hiding them, etc. doesn’t work.  native.* objects are always on top.

This is a physical limitation on how Corona’s display objects are built.

Rob

All I was thinking is that nativetextobject.isVisible=false then out of tableview viewing area.  set back to true when it is dragged back in.  I realize you can’t make them truly part of a displaygroup.  

This is basically, what I am going to try to accomplish in the tableview listener.  

Wish me luck. 

I think this is the best I can do given the limitations.  

https://youtu.be/GJ0GF0O9YZA

Maybe this could be the default behavior in the future for everyone???

I like your solution. As another option, I created something that uses a hidden native box to edit a row of the grid. This is very rough code but should give an idea.

Video:

https://youtu.be/4zyBk9BAbvc

Code:

https://gist.github.com/agramonte/39af20ce28761e493b46b97777b0bf73