Methods for incorporating rtl functionality into Angular Chosen

I am currently using Angular with Chosen (source) and I am attempting to implement right-to-left (RTL) support. Here is my demo, but despite referencing resources, I am encountering issues.

The main problem arises when the body element has a dir="rtl" attribute set. Upon clicking on the select list, the page gains horizontal scrolling.

<select class="chzn-rtl" chosen disable-search="false"
  no-results-text="'Tough luck'"
  ng-model="bar">
    <option>Hi</option>
    <option>This is fun</option>
    <option>I like Chosen so much</option>
    <option>I also like bunny rabbits</option>
    <option value=""></option>
  </select>

See the demo here

Answer №1

The issue arises because the chosen dropdown never closes properly and upon startup, it aligns to the far left where the scrollbar ends.

CSS

.chosen-container{
  .position: fixed;
  z-index: 99;
}

Incorporating this code into your styles will resolve the problem. I have not come across a more elegant solution so far, but this workaround seems to do the trick.

Check out the Working Plunkr here

Thank you.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Instructions for adjusting the size of my modal window when the keyboard appears?

While developing a next.js app, I encountered an issue with the chat modal. When the input field is in focus, I want to resize the modal height so that the keyboard popup does not hide the input field. I attempted to modify the DOM but could not get it to ...

Update the icon using CSS style properties

I have been using liqour-tree and I need to change the arrow icon to a custom one. Unfortunately, I am not sure how to do this. Can someone please help me out? I have identified the element tag where the icon is placed. <i class="tree-arrow expanded ha ...

What is the best way to adjust a div's size according to the device's screen dimensions?

I'm in the process of developing a web app that will be used on iOS devices, specifically targeting both iPhone 4 and iPhone 5. During my development phase using an iPhone 5 device, everything seemed to fit perfectly and work seamlessly. However, when ...

Effortlessly retrieving the id attribute from an HTML tag using jQuery

Currently, I am encountering an issue with a code snippet that is designed to extract the value from an HTML tag. While it successfully retrieves a single word like 'desk', it fails when attempting to do so for an ID consisting of two or more wor ...

rectangle/positionOffset/position().top/any type of element returning a position value of 0 within the container

While the height/position of the container is accurately displayed, attempting to retrieve the top position (or any position) of containing elements yields a return value of 0. Additionally, using .getBoundingClientRect() results in all values (top, left, ...

Is it possible to use the AngularJS function with the <div> HTML element?

I am facing an issue with displaying a modal when clicking on a <div> element. The function assigned to show the modal by changing the CSS property 'display' from 'none' to 'block' works fine when attached to a button, b ...

Can you explain the functionality of the filter feature in AngularJS?

I have a dynamically created table using ng-repeat with data from an array of objects. Currently, I want to implement a search functionality in the table using a text input field. The objects in my array have nested properties. Strangely, the filter onl ...

What is the best way to align HTML inputs within a grid, whether it be done automatically or manually using JavaScript?

Arrange 20 HTML inputs with various data types into grid-columns as the user inputs data. Ensure that the grid container has div elements correctly positioned for output. ...

What methods can be used to retrieve text data from a website built with Angular technology?

Exploring new territories with Angular and Selenium, I find myself facing a challenge in extracting specific text fields from a website. The precise value seems elusive within the intricate web of HTML code. Seeking guidance or tips from experienced indivi ...

Utilize jQuery to hide and then show elements based on text input

Recently, I came across a useful jQuery filter example that sparked my interest. To test it out, I created my live example and shared the code on CodePen (or you can check out the Fiddle if you prefer). One issue I encountered was that after entering text ...

Having trouble loading a CSS file in CodeIgniter?

I've added a link to my header.php and despite trying various solutions from stackoverflow, it still isn't working for me. Can someone please help? Thank you in advance :) Here's my folder structure: Main Folder: ci_attl - application ...

Changing the order of rows and columns with CSS3 and DOM manipulation

I have implemented the following CSS code to alternate the background color of li elements. However, I am facing an issue where I need the CSS styling to remain consistent even if the rows have the .hidden class applied to them (with .hidden class having d ...

Javascript: Troubleshooting Unexpected Variable Behavior in HTML Code

My issue is as follows: I am attempting to retrieve text from a JSON file in my HTML. In the header of my HTML, I have linked a tag with the following code: var language = ""; var langDoc = null; //Function to change the value function setLang() { v ...

Implementing CSS styles to Iframe content

I have written the following code snippet to display an iframe: <iframe scrolling='no' frameborder='1' id='fblike' src='http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.XYZ.com%2F&amp;send=false& ...

Render inline CSS styles with AngularJS

Can we use angular variables to write inline CSS styles? <div style="background: transparent url({{eventInfo.eventHeaderImg}}) top center no-repeat;"></div> Here is the output I received: "NetworkError: 404 Not Found - http://test/eventInfo. ...

Launching Android Calendar app using Intent from a web browser (Chrome)

Did you know that you can use HTML links to open Android apps from within Chrome? Take a look at this resource. If you're trying to open the calendar app from an Android app, the intent should be content://com.android.calendar/time. Learn more about ...

Intellisense feature for Protractor in Visual Studio 2013

As a newcomer to the world of node.js, angular.js, protractor.js and jasmine.js, I must admit that I am not well-versed in web development. However, I am currently working on creating some protractor tests for an Angular app and so far, things are going sm ...

Using jQuery to sift through and sort through content

I have successfully implemented a basic filter using HTML and jQuery. The issue I am facing is that when all filter options are unchecked, it displays no results. My goal is to modify the functionality so that when all checkboxes are deselected, it automa ...

Challenges encountered when redirecting users with a combination of javascript and php

I have a login form that triggers a JavaScript function upon submission. This function calls a PHP page to process the input. The issue I'm facing is with how the redirections are displayed based on the user's role type. It attempts to display t ...

Are DIV elements really impossible to click using selenium Web Driver?

Can DIV elements be clicked using selenium Web Driver? For example, I'm having trouble clicking the delete button in Gmail. https://i.stack.imgur.com/zsyio.png I've been trying to locate the element using the XPATH = //div[@aria-label='De ...