3 ms·
If a designer gives you 2 images to use for a radio button can you do a correct radio button in 1 minute (no third party libs?) By extending a RadioButton and
by simion314 6y ago
If a designer gives you 2 images to use for a radio button can you do a correct radio button in 1 minute (no third party libs?)
By extending a RadioButton and overriding the paint method I can do it in 1 minute. The component would still be a radiobutton, same interface, same events,same keyboard shortcuts, same accessibility, focus/tab-order behaviour.
In React you would start with a div, put 2 img inside it and implement the toggle logic, After that you need to add the events, the keyboard shortcuts, the tab ordering, focusing, accessibility.
- pier25 6y agoRight, but the problem you're describing is not the failure of React to compose components, but the fact that in-browser elements are not React components. If you had a library of React components, and it had a BaseRadioButton, if properly designed you could use it to compose other components (radio buttons, forms, etc).
- simion314 6y agoYes, my issue is with the DOM itself and the browser makers that add new stuff all the time but they have not added any major improvements to the included elements and add the needed one. Part of the solution would be to have Mozilla and google check what developers need and add that but IMO there is a giant chance a Google developer will invent yet another framework instead of working on adding more css support for the "select" or scrollbars.
- 5Qn8mNbc2FNCiVV 6y agoI mean I would not just add images as radio buttons but if that's the criteria you're going for: Yes, it would only take me a minute and it would have all the events, keyboard shortcuts, tab ordering, focusing and accessibility. Apart from the fact though that your understanding of a toggle on the web is switching visibility on images instead of building the button how the design wants it and not unnecessarily load images shows that you not only sound quite like an ass but are also so stuck up that you think your understanding is good enough to compare your experiences. Hint: It's not. Get over yourself and maybe put on a gentle tone next time you're trying to make a bad argument. This is also pure gold that I can't believe you actually would do > start with a div
- simion314 6y agoI apologize if I expressed myself aggressive, my comments were not addressed as an attack to a specific person or framework. Let me know about how would you implement it in 1 minute, I want to know because it seems I missed this method you are speaking of and I really need to learn it. What was such terrible about "start with a div" all components I seen so far start like that see for example https://getbootstrap.com/docs/4.0/components/dropdowns/ https://getbootstrap.com/docs/4.0/components/dropdowns/ Honestly I am not sure what triggered you, I had a nice dialog about what is missing with the DOM , the other comment acknowledge my point and I am confused by your aggressive tone(english is not my native language so did I used the wrong word or what triggered this response?)