problem with select2 and RTL language

Hi,
I’m using phpmaker 2022. I want to use select2 for a field. (RTL)
my code:

			<select multiple="multiple" id="HelpDocs">
			<?php
			$sql = "SELECT edudocs.*, members.FullName FROM edudocs join members on edudocs.User = members.MemberID WHERE edudocs.User = '".$myRow['User']."' OR edudocs.IsPublic = 'Y' ORDER BY edudocs.DocTitle ASC";
			$stmt = ExecuteQuery($sql);
			if ($stmt->rowCount() > 0) { 
			while ($row = $stmt->fetch()) {
			if ($myRow['AttachedFiles']){
			$packs = explode(',',$myRow['AttachedFiles']);	
			if (in_array($row['ID'], $packs)){
			$selected = "selected";		
			} else {
			$selected = "";	
			}	
			}
			echo "<option value=\"".$row['ID']."\" $selected>".$row['DocTitle']." | ".$row['FullName']."</option>";	
			}
			}
			?>
			</select>



        $("#HelpDocs").select2({
        placeholder: 'انتخاب بسته درمان',
        language: "fa",
		width: '100%'
        });

The problem is that the select2 search box width is NOT 100% and when I try to edit the selected value the search box was shown on the right?How can I use MODAL in this case?
Thanks

You may read Select2 Options about dir and width.

Hi,
Thank you for reply. I tested all select2 options but the problem exists.
The list of options goes out of page border (right border and the item titles can’t be read).
How may I use modal in this case (like regular phpmaker select).thanks

mansour wrote:

The list of options goes out of page border (right border and the item titles can’t be read). >

If your options’s content is lengthy, it will happen because Select2 uses white-space: nowrap; in CSS, setting the width to “100%” has nothing to do with it…

How may I use modal in this case (like regular phpmaker select).

What is “modal” and “regular phpmaker select”? If “modal” means Modal Lookup, you should enable modal lookup for the field. If “regular phpmaker select” means native HTML select tag and your field is select-one (not select-multiple) field, you may enable the advanced setting “Use native SELECT tag for select-one fields”.