Closed Bug 1011351 Opened 10 years ago Closed 10 years ago

Create gaia-textinput web component

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86
macOS
defect
Not set
normal

Tracking

(b2g-v2.0 fixed)

RESOLVED FIXED
2.0 S2 (23may)
Tracking Status
b2g-v2.0 --- fixed

People

(Reporter: kgrandon, Assigned: kgrandon)

References

Details

(Whiteboard: [p=3],[systemsfe])

Attachments

(1 file)

46 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
The text input is a fairly simple web component that is found all over gaia. Something that drives me crazy is that we have a lot of duplicated logic in order to have a simple reset button. A component would be a nice way of abstracting this. It would be good to implement a web component for this in shared/elements. 

You can find some examples here: http://buildingfirefoxos.com/building-blocks/input-areas.html
Attached file Github pull request
I'm pretty happy with how this is coming, but running into a few platform bugs. The main one being that modifying the value attribute will cause Firefox to crash. Will open bugs or sit down with William on how to address these.
Filed bug 1011353 to track a crash, but I think we should probably land and iterate on it while the platform bug is being fixed.
Comment on attachment 8423547 [details] [review]
Github pull request

Hey Guys - got time for a review on this one?

I would like to flush this out a bit more, but there is still some platform work to do with form controls. In the meantime, I think we should get this landed so we can add additional functionality/tests as platform code lands. This way we can get tests on TBPL and platform functionality will not regress us.
Attachment #8423547 - Flags: review?(yor)
Attachment #8423547 - Flags: review?(wilsonpage)
Attachment #8423547 - Flags: review?(21)
Comment on attachment 8423547 [details] [review]
Github pull request

Looks good, a few nits:

- <gaia-textinput> or <gaia-text-input>?
- Browser crashes when I try to 'clear' (already known)
- Can't seem to be able to focus the first field in the example.
- <p> tag in markup is confusing, not sure what it's for.
- Do we really need `data-`, makes everything very messy. It would be nice to have shiney examples of web-components to really show off the web-platform. `data-` makes it look like we're working round a platform deficiency.
Attachment #8423547 - Flags: review?(wilsonpage) → review+
Comment on attachment 8423547 [details] [review]
Github pull request

Yeah, I agree about the 'data-' thing. In my other PR we remove it from the switch element, so maybe we can un-namespace these as well? I'll revisit with some fixes, and I'm sure we'll need to tweak/polish these form controls in the future, especially as we get more platform support.

Thanks for the quick review.
Attachment #8423547 - Flags: review?(yor)
Attachment #8423547 - Flags: review?(21)
Ok, this will probably need some clean-up and additional testing once we have better platform support, but I've landed this for now and we can update as needed: https://github.com/mozilla-b2g/gaia/commit/6399491b1b790becd8ae698ead2438b872334ef4
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S2 (23may)
Alias: gaia-textinput
No longer blocks: gaia-web-components
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: