amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Can't set RTL on input nor amp-autocomplete or form

Open omar-dulaimi opened this issue 5 years ago • 2 comments

What's the issue?

An input field/form/amp-complete should have the ability to set the dir property to change direction from LTR to RTL. Also, both the cursor and text are aligned left not right.

How do we reproduce the issue?

                <form
                                         className="amp-search-areas-form"
                                         method="get"
                                         action-xhr={`${hostName}/search`}
                                         target="_top"
                                         id="searchform"
                                         dir="rtl"
                                     >
                                         <amp-autocomplete
                                             filter="substring"
                                             filter-value="name"
                                             src={`${hostName}/api/areas`}
                                             query="name"
                                             submit-on-enter="true"
                                             highlight-user-entry="true"
                                             items="items"
                                         >
                                             <input
                                                 dir="rtl"
                                                 type="search"
                                                 name="queryInput"
                                                 on="input-throttled:AMP.setState({ area: event.value })"
                                                 role="areasearch"
                                                 tabIndex="3"
                                                 className="amp-search-areas-input"
                                                 placeholder="مثال (نص بالعربي)"
                                             />
                                             <AmpMustache
                                                 template={`
                                                         <div data-value="{{name}}">
                                                             <div>{{ name }}</div>
                                                         </div>`}
                                             />
                                         </amp-autocomplete>
                                     </form>

What browsers are affected?

All browsers

Which AMP version is affected?

2008220050001

Update

I was able to fix this issue by this:

 amp-autocomplete > input,
            amp-autocomplete > textarea {
                font-size: large !important;
                direction: rtl !important;
                font-weight: 500 !important;
                padding: 0 14px 0 14px !important;
  }

omar-dulaimi avatar Sep 06 '20 12:09 omar-dulaimi

Any updates on this?

omar-dulaimi avatar Feb 21 '21 11:02 omar-dulaimi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 19 '25 08:07 stale[bot]