This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Daniel Rakh
Posted Aug 19 - Read on Facebook

Hey all...coming from an iOS background here and getting stuck on simple JS/CS/CSS stuff is really humbling haha. Anyways, I can't figure out for the life of me on why when I add a "textInputLayer" as a sublayer of a page of a Page Component I can't seem to be able to select the text to edit. It's almost as if touch/click event is being obstructed by something else. Feels like a hierarchy issue of some sort but I can't seem to figure it out. Any ideas?

21 Comments

Daniel Rakh

Just to add... when I place that "textInputLayer" as a subview of the Page Component Layer (not it's content layer) or any other layer in the general hierarchy...it seems to work just fine.

Jordan Robert Dobson

Are you adding it to the Page Component or the content layer of the Page Component?

Jordan Robert Dobson

You want to add it to myPgComp.content

Daniel Rakh

So out of the box you get PageComponet -> PageContent right? Then you could add layers as pages to PageContent right? So I'm adding a layer where I could input text on one of those pages and i can't seem to select it after I do that.

Daniel Rakh

Even when I add it to myPgComp.content I can't select it.

Daniel Rakh

If i add it to myPgComp I could.

Jordan Robert Dobson

Yeah you get a content layer and the root layer when you create a page Component. Each item you add to the content (depending on how you add it) that addition becomes a “page".

Jordan Robert Dobson

I can take a look if you want to send me an example file.

Daniel Rakh

Jordan Robert Dobson let me know if you figure anything out : )

Jordan Robert Dobson

I'll look tonight. Watching a film with the kids now. Something about Sanfransokyo?

Daniel Rakh

Haha Big Hero 6?

Jordan Robert Dobson

Yeah never heard of it. ;)

Jordan Robert Dobson

I’m pretty sure the layer is capturing the events before the text field does. But this seems to work fine: http://share.framerjs.com/a7dsu46ue3cv/

Daniel Rakh

Awesome. Thanks for the help Jordan!

Daniel Rakh

Hey Jordan sorry to bother and rehash this issue again but I was wondering if you could help me out with the same issue when I use this instead of creating my own input layer from scratch: https://github.com/awt2542/textLayer-for-Framer for the textLayer. I can't call focus() on the Layer and I tried setting ignoreEvents on the all the other layers besides that one.

Daniel Rakh

And if you're wondering why I'm using that in the first place, it's because I'm looking to have the input auto resize it's height as it grows based on a set width.

Jordan Robert Dobson

You probably want to target the input not the layer.

Jordan Robert Dobson

This might help you get started... just log the layers element and look at the output in the console.

console.log myLayer._element

Daniel Rakh

Yeah I kept getting "undefined" for the input on the layer. Weird. But I'll chew on it. Appreciate all the help you're giving. Really means a lot : )

Jordan Robert Dobson

no... actually use _element :)

Read the entire post on Facebook