Skip to content

Commit

Permalink
Add special case directionality of phone input
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Feb 24, 2020
1 parent 35d340d commit 6188116
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions components/script/dom/htmlelement.rs
Expand Up @@ -787,6 +787,12 @@ impl HTMLElement {
return Some("rtl".to_owned());
}

if let Some(input) = self.downcast::<HTMLInputElement>() {
if input.input_type() == InputType::Tel {
return Some("ltr".to_owned());
}
}

if element_direction == "auto" {
if let Some(directionality) = self
.downcast::<HTMLInputElement>()
Expand Down
1 change: 0 additions & 1 deletion components/script/dom/htmlinputelement.rs
Expand Up @@ -330,7 +330,6 @@ impl HTMLInputElement {

pub fn auto_directionality(&self) -> Option<String> {
match self.input_type() {
InputType::Tel => return Some("ltr".to_owned()),
InputType::Text | InputType::Search | InputType::Url | InputType::Email => {
let value: String = self.Value().to_string();
Some(HTMLInputElement::directionality_from_value(&value))
Expand Down

0 comments on commit 6188116

Please sign in to comment.