bigskysoftware / bigskysoftware/_hyperscript

set a (same) class to a next element using the class to find the first element

Đang mở
#413 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
3.8k
Fork
172
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello,

I have a input field and a list. the input field contains script.
When the input field is changed, the list will shift the selected class to the next element. Snippet code example:

```








```
This isn't working. Due to the `from .selected`
my understanding from thr docs:

`(next|previous) [from ] [within ] [with wrapping]`

is that after the from an expression is allowed to defined a starting point other that `me` wich is the input field and not usable.
Also my understanding of expression can be anything as from the doc:
```
Others are a bit more exotic and, for example, make it easy to work with the DOM:

ID References: #foo
Class References: .tabs
Query References:


Attribute References: @count
```

I tried to use something else like adding ID (hacking on a li the id via console) as reference and then the line works:
` add .selected to the next

  • from #selected within #autoCompleteCustomer`
    However, I cannot seem to find the way to add an `ID=selected` via hyperscript.

    So I am stuck.
    Could you help me to clarify what the document now means concerning `expression` and if it is possible to add an id via hyperscript?

    thanks in advance

  • Hướng dẫn đóng góp

    Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

    Hướng nghiên cứu

    Start from the issue's hyperscript snippet and the documented `(next|previous) [from ] [within ]` syntax. Reproduce the `.selected` and `#selected` variants, then compare the expression and DOM-reference behavior; done means the documented syntax and a hyperscript way to identify or update the selected list item are clarified.

    Do mô hình lập chỉ mục viết ra từ nội dung của issue.

    Đánh giá

    Công nghệ
    javascript
    Lĩnh vực
    frontend, web-dev
    Loại issue
    Lỗi
    Độ khó
    3/5
    Thời gian dự kiến
    1-2 ngày
    Mức độ hoạt động
    Đình trệ
    Độ rõ ràng
    Khá rõ ràng
    Mức phù hợp với người mới
    38/100

    Nhận issue mới trong hộp thư của bạn

    Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.