-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Right-to-Left support for form elements (text field, text area, select, etc.) #4306
Comments
As I understand your feature request is support for RTL languages, right? How would you envision such support? I'd assume it would be globally applied (per form)? |
Yes. In forms, it'd be awesome if we could choose the direction for each element (maybe via the properties panel). Then the element positioning may be done using the resize option. However, I also noticed this unusual behavior for resizing elements which is discussed here as well. |
What is the use case for maintaining RTL for each element? Do you envision forms to mix RTL and LTR language inputs? |
Related issue: bpmn-io/form-js#1185 |
No. It is not necessary for the form to include input values in both English and non-English languages. Maybe it's just better to be a preference setting for the whole form. It can be added to the form properties where we can set its unique ID. |
This is what I thought, too. Thanks for confirming. Could you create another FR for this issue:
|
I'd be grateful if you guys keep me informed of this issue. It's of high importance for my organization. |
@okaeiz Consider to contribute if this is important to your organization. |
I have played around with adding custom components to form-js and I managed to create an RTL text input field which has RTL labels and values. But I think the form-js repository seems forgotten and nothing is happening there exactly. Should I consider contributing to Modeler? As you can see, I have created a |
@okaeiz As we discussed:
Let's not require users to configure it locally, but rather inherit the value from the global form configuration, if provided. Or did you change your mind and think that this provides value to configure it for each element indivudually? I'm not sure why you'd want a separate |
@okaeiz We're currently in a large refactor on form-js which is why a lot of the other topics have taken a backseat, but it is definitely where such a feature should be contributed. I can offer some guidance on the issue you raised there as well, but generally I agree where this discussion is going. I'll get into more detail on the form-js issue, but one single boolean config should drive this feature. No custom components needed. |
@nikku @volodymyr-melnykc @Skaiir I appreciate your guidance.
Absolutely not. I adhere to what we've discussed before. I was just following the official Camunda docs, the section on Custom components and its examples because I didn't fully comprehend what exact part of the form-js codebase I should head to in order to define a global RTL option for the form.
Is it the form-js-editor package that I need to play around with? I am definitely ready to contribute and will be grateful if you help me find the proper spot of the codebase. Here's what I think I should do: I need to add another section to the panel (maybe?) in addition to |
@okaeiz I suggest adding the |
@volodymyr-melnykc Does this really make sense? I'm not sure there's a use case to have two different text directions within the same form. @okaeiz To answer your initial question, the Also, regarding what I mentioned in the other issue, forget about it, it's for external configuration only, we can handle this later ourselves when we'll need it ;) |
@Skaiir @volodymyr-melnykc Thank you; I'll look into it. I think these solutions are both useful in specific cases. For instance, we may ask Persian users to enter their full name and profession - which is RTL - and their company website URL - which is LTR - and it may require separate options for each form component. Personally I prefer the global solution but it's actually up to you to decide. |
@okaeiz After having an internal discussion about it, the direction can be defined on a form level, so you can disregard my previous comment. |
@volodymyr-melnykc @Skaiir |
RTL-Demo.mp4@volodymyr-melnykc @Skaiir I added the global entry for the form and I'm starting to make it affect all the components. I have also added a preferred font to Persian strings. Is it okay? |
@okaeiz It looks good! |
I used a Google valid font in the style attribute. I plan to apply it only when the direction is RTL. However, It looks decent on the non-Persian strings too. |
Hey there! @volodymyr-melnykc |
Hey there! I just got 5.29.0-dev and I noticed it has a file picker component and it's great. I think if you take a look at my PR and review the options on right to left support and Jalali datepicker, it would attract a massive amount of people to the software. |
Problem you would like to solve
I have just updated the Modeler to v5.23.0 and I can see a HTML View component is added and it is great for customization and font changes, especially for RTL languages like Persian and Arabic. But as declared in the official docs, the section on security and sanitation strategy, it's for information presentation purposes only. Therefore, it cannot be used for input fields.
On the other hand, the input fields (such as text fields or date-time) do not support right-to-left languages. It can be frustrating when creating forms in those languages.
Proposed solution
Alternatives considered
First, I thought I could achieve this by creating input fields in HTML View element but since it is disabled due to XSS and clickjacking attacks, it doesn't seem like a good idea. Moreover, the passing of values in the workflow may be tricky in this way.
Additional context
No response
Depends on bpmn-io/form-js#1185
The text was updated successfully, but these errors were encountered: