antizer icon indicating copy to clipboard operation
antizer copied to clipboard

Om Next support?

Open Driphter opened this issue 7 years ago • 3 comments

Any chance of Om Next support being implemented?

Driphter avatar Aug 25 '17 02:08 Driphter

I'd be interested in this too. I wonder how hard it would be? Looking at how the Reagent and Rum components are defined there's a macro that builds them and is mapped to the collection of antd components.

It might be easier than we think?!?

pablinos avatar Sep 23 '17 21:09 pablinos

Actually @sctianwei (thanks!) has done some work on adding Om Next support here:

https://github.com/sctianwei/antizer/commit/5247fcce4ab03351ee021ee0a5443250c7e4f7d8

However, I noticed that there's an issue. It seems like the antd library's getFieldDecorator function is not actually being called. Hence the components (eg: text input) are not clickable, until the following function is called on on-change.

(defn handle-fields-change[comp]
  (om/update-state! comp assoc :form (ant/get-form comp)))

This workaround works, but it can be error-prone since you have to call it for all the form controls and I have not tested enough to see if there are any other unexpected behaviour.

@sctianwei Could you explain what led you to do the workaround above? Thanks!

priornix avatar Aug 13 '18 03:08 priornix

@priornix it's not the final solution, I do this only want the form can just work. actually, I've done some debug, the getFieldDecorator get called, the value changed at first, but somehow it get reverted after re-rending.

sctianwei avatar Aug 15 '18 14:08 sctianwei