space10-community / conversational-form

Turning web forms into conversations
https://space10-community.github.io/conversational-form/
MIT License
3.8k stars 778 forks source link

Custom input attribute to pass on to event listerner #432

Open carlmagumpara opened 3 years ago

carlmagumpara commented 3 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I want to pass a custum attribute to event listerner

Sample formless data { 'tag': 'input', 'type': 'text', 'name': 'sample', 'cf-questions': 'Sample question', 'required': true 'cf-data': JSON.stringify(dataobj), <--- data to pass to event listerner }

in event listener

const dispatcher = new EventDispatcher(); dispatcher.addEventListener(FlowEvents.FLOW_UPDATE, function(event) { console.log(event.detail); <---- data here // your code here }, false);

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.