CyclicMaterials / molecule-input

A Material Design text field
MIT License
16 stars 3 forks source link

let molecule-textarea listen for events on immediate child #4

Closed Frikki closed 9 years ago

Frikki commented 9 years ago

Overview

As it stands now, molecule-textarea listens for events on elements hosted in atom-autogrow-textarea. This requires molecule-textarea to have knowledge of the inner compositions of atom-autogrow-textarea.

We should change the event listeners to listen on atom-autogrow-textarea instead.

Motivation

Having knowledge of the inner workings of another module, and operating on that knowledge, causes architectural rigidity, fragility, immobility, and makes the viscosity of the design high.

Suggested Fix

This probably requires modification of atom-autogrow-textarea to allow emission of events on it’s outermost element.

Frikki commented 9 years ago

The way to overcome this obstacle is to use capturing events. See https://github.com/cyclejs/cycle-dom/issues/41